Jquery and bootstrap both not working

Here’s my …

application.js

//
//= require jquery2
//= require jquery_ujs
//= require bootstrap-sprockets
//= require bootstrap
//= require bootstrap-image-gallery
// require turbolinks
//= require blueimp-gallery
//= require blueimp-gallery-fullscreen
//= require blueimp-gallery-indicator
//= require blueimp-gallery-video
//= require blueimp-gallery-youtube
//= require jquery.blueimp-gallery

Here’s my application.css

*= require_self
*= require bootstrap
*= require blueimp-gallery
*= require bootstrap-image-gallery
*= require blueimp-gallery-indicator
*= require blueimp-gallery-video

And from my view:

<%= yield(:title)%> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> ...

//= require bootstrap

<%= yield(:title)%>

These bottom-linked scripts are redundant, and depending on how they
were written, may cause their primary instance to fail.

Any time you add a script to the application.js either literally or with
require tree, it gets inlined and minified into the one monolithic
application.js file, and linked at the head level of the page. If your
script is explicitly written to be linked at the bottom of the page,
then it may not be prepared to wait until all the rest of the page is in
place before trying to find its referenced elements. This will fail
because it is referencing a page element that isn’t there (from its
point of view at the top of the page). If that error isn’t caught
properly, then the script can cause later scripts to either fail as well
or never even try to run.

Walter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs