From 973bd54d83f38747015e3d85d7f9fa1ee86b6270 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Tue, 7 Oct 2008 05:43:44 -0500 Subject: Added some additional detail on asset caching syntax. --- .../doc/guides/actionview/layouts_and_rendering.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'railties/doc/guides/actionview') 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 ++ 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: -- cgit v1.2.3