samedi 21 février 2015

Ruby on Rails: Asset pipeline failing for only some of my assets (javascripts)


In my application.js I have



//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require s3_direct_upload
//= require_tree .


I also have 4 javascript files in the javascript folder other application.js. They are: users.js, access.js, documents.js, and bands.js.


I wrote some javascript code in documents.js and it worked fine. I then tried writing code in bands.js and nothing happened, as if the javascript file were not even loaded. I then decided to do a simple test and wrote an alert("Hello"); message at the top of each of my javascripts and it turns out that the alert message only pops up for documents.js and users.js, not for any of the others (that is, when I visit the index page for the corresponding views). It seems kind of random. I have tried restarting my server a few times and nothing changed. This seems really odd to me. I couldn't think of any code to provide that would be useful but let me know if there's some code you would like to see. How can I make my javascript responsive across all pages that they supposedly apply to? Please help!!





Aucun commentaire:

Enregistrer un commentaire