I translated the application into Rails 3.1 (and now at 3.2) and looked at Railscast in the asset pipeline . I moved all the files of third-party jquery plugins to the / vendor / assets / javascripts / directory. In my /app/assets/javascripts/application.js, I have the following:
//= require jquery //= require jquery_ujs //= require_tree . //= require_self
I realized that calling require_tree . only loads the tree for the / app / assets / javascripts / directory. (Is this right?) What is the best way to include all the "vendor" javascripts? (I'm not worried about ordering at the moment.) Of course, I could request them one by one in /app/assets/javascripts/application.js. My other thought was to create / vendor / assets / javascripts / vendor _javascripts.js with the following:
And then in /app/assets/javascripts/application.js add the following:
//= require vendor_javascripts
It seems a little awkward. Is there a better way to automatically include all "vendor" (and / or "lib") javascripts?
PS. I saw about index.js files , but I could end up creating several files called index.js, right? Oh, and I tried restarting my server.
robertwbradford Jan 25 '12 at 17:05 2012-01-25 17:05
source share