I'm moving an app from Rails 2 to Rails 3. I have a bunch of JavaScript files in the app, most of which are for working with Google Maps. Previously, my JS files were in public/javascripts/*.js. I noticed that they were not being loaded by any of the pages that used javascript_include_tag, which writes a JavaScript tag that tries to load the JS file from /assets/*.js. (e.g. /assets/application.js).
I read that Rails 3 expects JS files to be located in app/assets/javascripts/*.js. So I moved my JS files there, but they still won't be accessible at /assets/application.js, unless I run bundle exec rake assets:precompile first.
I can't have my JS development cycle be:
- Make change to JS
- Run bundle exec rake assets:precompile
- Reload browser
Thats just too long. My question is how can I configure my app so that the development cycle is as follows?
- Make change to JS
- Reload browser
So far I've tried:
- Enabling the line that reads "Bundler.require(:default, :assets, Rails.env)" in config/application.rb
- Setting config.assets.enabled = false (and true) in config/application.rb
Thanks in advance.