aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-12-03 18:06:02 +1100
committerRyan Bigg <radarlistener@gmail.com>2010-12-03 18:06:02 +1100
commitb800125ae8a9ab1a1b4d773f21b4275a36fb0351 (patch)
tree502f64c3abb852282686fc8384cc793e260019ba /railties/guides/source
parent04779fbadd4e77887a8899585f01141cfc27babc (diff)
downloadrails-b800125ae8a9ab1a1b4d773f21b4275a36fb0351.tar.gz
rails-b800125ae8a9ab1a1b4d773f21b4275a36fb0351.tar.bz2
rails-b800125ae8a9ab1a1b4d773f21b4275a36fb0351.zip
Config guide: Add javascript_expansions and stylesheet_expansions
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/configuring.textile24
1 files changed, 24 insertions, 0 deletions
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:
+
+<ruby>
+ config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] }
+</ruby>
+
+However, you may add to this by defining others:
+
+<ruby>
+ config.action_view.javascript_expansions[:jquery] = ["jquery", "jquery-ui"]
+</ruby>
+
+Then this can be referenced in the view with the following code:
+
+<ruby>
+ <%= javascript_include_tag :jquery %>
+</ruby>
+
+* +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:
+
+<ruby>
+ <%= stylesheet_link_tag :special %>
+</ruby>
+
* +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