Skip to content

Commit

Permalink
Clarify that per-controller asset files are not 'magically' loaded by…
Browse files Browse the repository at this point in the history
… the controller, but rather need to be required
  • Loading branch information
radar authored and fxn committed Jul 9, 2011
1 parent d17d455 commit d0f9a31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/guides/source/asset_pipeline.textile
Expand Up @@ -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
Expand Down

0 comments on commit d0f9a31

Please sign in to comment.