Permalink
Browse files

Clarify that per-controller asset files are not 'magically' loaded by…

… the controller, but rather need to be required
  • Loading branch information...
1 parent d17d455 commit d0f9a31a0d7645be5db63866e3ef34af6cf92a13 @radar radar committed with fxn Jul 8, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/guides/source/asset_pipeline.textile
@@ -88,7 +88,7 @@ This is not to say that assets can (or should) no longer be placed in +public+.
When a scaffold or controller is generated for the application, Rails will also generate a JavaScript file (or CoffeeScript if the +coffee-script+ gem is in the +Gemfile+) and a Cascading Style Sheet file (or SCSS if +sass-rails+ is in the +Gemfile+) file for that controller.
-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 can put any JavaScript or CSS unique to a controller inside their respective asset files.
+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] %>+.
h4. Asset Organization

0 comments on commit d0f9a31

Please sign in to comment.