Possible Duplicate:
Rails 3.1 asset pipeline: how to load controller-specific scripts?
Upon creating a new controller and associated view, Rails produces some empty view-specific assets. Take the following command:
rails generate controller home index
This will generate home.css.scss
and home.js.coffee
. Being new to Rails, my initial thought was that these would be auto-configured to only render in their respective views. It turns out that this is not the case. Instead, the default is that all scripts are rendered in all views. Is this expected? What's the best way to make these assets view-specific?