Skip to content

Commit

Permalink
adds a mention of the fact that an engine's lib/assets directory is a…
Browse files Browse the repository at this point in the history
…lso on the load path
  • Loading branch information
lazylester committed Apr 25, 2012
1 parent 4a3ce15 commit 0476001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/source/engines.textile
Expand Up @@ -695,7 +695,7 @@ If a template is rendered from within an engine and it's attempting to use one o

h4. Assets

Assets within an engine work in an identical way to a full application. Because the engine class inherits from +Rails::Engine+, the application will know to look up in the engine's +app/assets+ directory for potential assets.
Assets within an engine work in an identical way to a full application. Because the engine class inherits from +Rails::Engine+, the application will know to look up in the engine's +app/assets+ and +lib/assets+ directories for potential assets.

Much like all the other components of an engine, the assets should also be namespaced. This means if you have an asset called +style.css+, it should be placed at +app/assets/stylesheets/[engine name]/style.css+, rather than +app/assets/stylesheets/style.css+. If this asset wasn't namespaced, then there is a possibility that the host application could have an asset named identically, in which case the application's asset would take precedence and the engine's one would be all but ignored.

Expand Down

0 comments on commit 0476001

Please sign in to comment.