I’m using Rails 3.2.9. I have some Javascript/jQuery libraries I use, so I placed them in /app/assets/javascripts. They automatically load and everything works fine because I have the following manifest in application.js:
//= require_tree .
But then I read I should be putting these things in /vendor/assets/javascripts. That directory is created, but empty, by default. So I moved my 3rd party libraries there. I can access them with http://0.0.0.0:3000/assets/jquery.qtip.min.js, for example. However, they are not included in every webpage now. It seems require_tree . needs a little more help to include vendor javascripts.
What’s the proper way to include 3rd party javascript/jQuery libraries in Rails?
In your
application.jsfile, you should add//= require filename. Example, I have a file calledjquery.markitup.jsin myvendor/assets/javascripts/, so this is how i added it: