ruby - After deploying rails app to Heroku, no dropdowns -


after deploying rails app heroku, there no dropdown menus!

when running locally, source looks :

        <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.core.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.theme.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.accordion.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.menu.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.autocomplete.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.button.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.datepicker.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.resizable.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.dialog.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.progressbar.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.selectable.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.slider.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.spinner.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.tabs.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.tooltip.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.base.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/jquery.ui.all.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/foundation_and_overrides.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/admins.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/associates.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/custom.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/dasharea.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/database.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/members.css?body=1" media="screen" rel="stylesheet" />     <link href="/assets/sessions.css?body=1" media="screen" rel="stylesheet" />         <script src="/assets/vendor/custom.modernizr.js?body=1"></script>         <meta content="authenticity_token" name="csrf-param" />     <meta content="anbyaccbloi2zpa9e2timosnibyn5kftc8heyi1te+i=" name="csrf-token" />          <script src="/assets/jquery.js?body=1"></script>         <script src="/assets/jquery.ui.core.js?body=1"></script>     <script src="/assets/jquery.ui.widget.js?body=1"></script>     <script src="/assets/jquery.ui.accordion.js?body=1"></script>     <script src="/assets/jquery.ui.position.js?body=1"></script>     <script src="/assets/jquery.ui.menu.js?body=1"></script>     <script src="/assets/jquery.ui.autocomplete.js?body=1"></script>     <script src="/assets/jquery.ui.button.js?body=1"></script>     <script src="/assets/jquery.ui.datepicker.js?body=1"></script>     <script src="/assets/jquery.ui.mouse.js?body=1"></script>     <script src="/assets/jquery.ui.draggable.js?body=1"></script>     <script src="/assets/jquery.ui.resizable.js?body=1"></script>     <script src="/assets/jquery.ui.dialog.js?body=1"></script>     <script src="/assets/jquery.ui.droppable.js?body=1"></script>     <script src="/assets/jquery.ui.effect.js?body=1"></script>     <script src="/assets/jquery.ui.effect-blind.js?body=1"></script>     <script src="/assets/jquery.ui.effect-bounce.js?body=1"></script>     <script src="/assets/jquery.ui.effect-clip.js?body=1"></script>     <script src="/assets/jquery.ui.effect-drop.js?body=1"></script>     <script src="/assets/jquery.ui.effect-explode.js?body=1"></script>     <script src="/assets/jquery.ui.effect-fade.js?body=1"></script>     <script src="/assets/jquery.ui.effect-fold.js?body=1"></script>     <script src="/assets/jquery.ui.effect-highlight.js?body=1"></script>     <script src="/assets/jquery.ui.effect-pulsate.js?body=1"></script>     <script src="/assets/jquery.ui.effect-scale.js?body=1"></script>     <script src="/assets/jquery.ui.effect-shake.js?body=1"></script>     <script src="/assets/jquery.ui.effect-slide.js?body=1"></script>     <script src="/assets/jquery.ui.effect-transfer.js?body=1"></script>     <script src="/assets/jquery.ui.progressbar.js?body=1"></script>     <script src="/assets/jquery.ui.selectable.js?body=1"></script>     <script src="/assets/jquery.ui.slider.js?body=1"></script>     <script src="/assets/jquery.ui.sortable.js?body=1"></script>     <script src="/assets/jquery.ui.spinner.js?body=1"></script>     <script src="/assets/jquery.ui.tabs.js?body=1"></script>     <script src="/assets/jquery.ui.tooltip.js?body=1"></script>     <script src="/assets/jquery.ui.all.js?body=1"></script>         <script src="/assets/jquery_ujs.js?body=1"></script> 

in heroku, :

<script src="/javascripts/jquery.js"></script> <script src="/javascripts/jquery.ui.all.js"></script> <script src="/javascripts/jquery_ujs.js"></script> 

but links in heroku return not found!

for special reason, included jquery in head manually :

<%= javascript_include_tag 'jquery' %> <%= javascript_include_tag 'jquery.ui.all' %> <%= javascript_include_tag 'jquery_ujs' %> 

is reason things failing? how fix without removing these head?

in (most) production setups, files in public/assets available use directly in link or script tags.

when push heroku, precompiles app/assets/javascripts/application.js merging , compressing javascript files required in application.js single file @ public/assets/application-xxxxxx.js. individual files, such jquery.js, not available. therefore, it's recommended use

<!-- html --> javascript_include_tag 'application'  // inside app/assets/javascripts/application.js //= require jquery //= require jquery_ujs 

however, if insist on including jquery manually without requiring in application.js, can add config.assets.precompile.

# config/environments/production.rb config.assets.precompile += ['jquery.js', 'jquery_ujs.js'] 

(note: friend told me heroku doesn't read production.rb during precompilation. if that's case, try adding above config/application.rb instead.)

when push heroku , precompile assets, should see

$ rake assets:precompile i, []  info -- : writing public/assets/jquery-36fecc5eda81b43bdf4f92ce2d874df2.js i, []  info -- : writing public/assets/jquery_ujs-02181b3e64cd9e4e8548cad033516231.js 

on heroku, script tags should like

<script src="/assets/jquery-36fecc5eda81b43bdf4f92ce2d874df2.js"></script> 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -