diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-07 05:43:44 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-07 05:43:44 -0500 |
commit | 973bd54d83f38747015e3d85d7f9fa1ee86b6270 (patch) | |
tree | da50b801287b7a2961dd61b478be6ea4b1ad300c /railties | |
parent | 7a920bca4df1809e6e4583df54b3580f8ed05ab7 (diff) | |
download | rails-973bd54d83f38747015e3d85d7f9fa1ee86b6270.tar.gz rails-973bd54d83f38747015e3d85d7f9fa1ee86b6270.tar.bz2 rails-973bd54d83f38747015e3d85d7f9fa1ee86b6270.zip |
Added some additional detail on asset caching syntax.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/doc/guides/actionview/layouts_and_rendering.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/doc/guides/actionview/layouts_and_rendering.txt b/railties/doc/guides/actionview/layouts_and_rendering.txt index 278cca20a6..01fd8256f4 100644 --- a/railties/doc/guides/actionview/layouts_and_rendering.txt +++ b/railties/doc/guides/actionview/layouts_and_rendering.txt @@ -427,6 +427,15 @@ If you're loading multiple javascript files, you can create a better user experi ------------------------------------------------------- <%= javascript_include_tag "main", "columns", :cache => true %> ------------------------------------------------------- + +By default, the combined file will be delivered as +javascripts/all.js+. You can specify a location for the cached asset file instead: + +[source, ruby] +------------------------------------------------------- +<%= javascript_include_tag "main", "columns", :cache => 'cache/main/display' %> +------------------------------------------------------- + +You can even use dynamic paths such as "cache/#{current_site}/main/display"+. ==== Linking to CSS Files with +stylesheet_link_tag+ @@ -486,6 +495,15 @@ If you're loading multiple CSS files, you can create a better user experience by <%= stylesheet_link_tag "main", "columns", :cache => true %> ------------------------------------------------------- +By default, the combined file will be delivered as +stylesheets/all.css+. You can specify a location for the cached asset file instead: + +[source, ruby] +------------------------------------------------------- +<%= stylesheet_link_tag "main", "columns", :cache => 'cache/main/display' %> +------------------------------------------------------- + +You can even use dynamic paths such as "cache/#{current_site}/main/display"+. + ==== Linking to Images with +image_tag+ The +image_tag+ helper builds an HTML +<image>+ tag to the specified file. By default, files are loaded from +public/images+. If you don't specify an extension, .png is assumed by default: |