From b800125ae8a9ab1a1b4d773f21b4275a36fb0351 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 3 Dec 2010 18:06:02 +1100 Subject: Config guide: Add javascript_expansions and stylesheet_expansions --- railties/guides/source/configuring.textile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'railties/guides/source') diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 83789ab710..837b3b563c 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -282,6 +282,30 @@ There are only a few configuration options for Action View, starting with four o * +config.action_view.erb_trim_mode+ gives the trim mode to be used by ERB. It defaults to +'-'+. See the "ERB documentation":http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/ for more information. +* +config.action_view.javascript_expansions+ a hash containining expansions that can be used for javascript include tag. By default, this is defined as: + + + config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] } + + +However, you may add to this by defining others: + + + config.action_view.javascript_expansions[:jquery] = ["jquery", "jquery-ui"] + + +Then this can be referenced in the view with the following code: + + + <%= javascript_include_tag :jquery %> + + +* +config.action_view.stylesheet_expansions+ works in much the same way as +javascript_expansions+, but has no default key. Keys defined for this hash can be referenced in the view like such: + + + <%= stylesheet_link_tag :special %> + + * +ActionView::Helpers::AssetTagHelper::AssetPaths.cache_asset_ids+ With the cache enabled, the asset tag helper methods will make fewer expensive file system calls (the default implementation checks the file system timestamp). However this prevents you from modifying any asset files while the server is running. h4. Configuring Action Mailer -- cgit v1.2.3