When I look at the source of any of my views generated in rails 3.1 mountable engine, I see all css and javascripts loaded. Isn't that inefficient? Wouldn't it be more efficient that I load the css and js which I need for that particular page?

1

There are 1 best solutions below

3
On BEST ANSWER

Are you in the development environment? In production, all of your assets will be compressed and precompiled, so that only application.js and application.css are linked. This is the best way, because the js and css for your whole site is loaded into the browser cache, so that when visiting different pages, it doesn't have to make a bunch of extra server requests.