I think the docs http://guides.rubyonrails.org/asset_pipeline.html need some clarification. They state:
For example, if a ProjectsController is generated, there will be a new file at app/assets/javascripts/projects.js.coffee and another at app/assets/stylesheets/projects.css.scss. You should put any JavaScript or CSS unique to a controller inside their respective asset files, as these files can then be loaded just for these controllers with lines such as <%= javascript_include_tag params[:controller] %> or <%= stylesheet_link_tag params[:controller] %>.
It is my understanding that in production mode, all JS gets packaged up into one optimized file, preferably. I'm guessing that caching of this optimized file is preferable to having pages specifically loading different sets of JS files themselves.
Maybe the point of the javascript_include_tag is to RUN some specific javascript to that page. However, the default for application.js is to include the tree, which includes the generated files. So I'm guessing that would have to be adjusted to NOT include any controller specific javascript.
This answer here Using Rails 3.1, where do you put your "page specific" javascript code? seems to suggest a reasonable way of handling the issue is to associate JS features with divs, and when JQuery does not see the div on the page, nothing is executed.
So what is the best practice? Is my understanding of the controller specific divs correct? Does the default to include the tree inside of application.js conflict with the goals of controller specific js?