aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorGrant Hutchins <nertzy@gmail.com>2012-03-28 20:05:26 -0400
committerGrant Hutchins <nertzy@gmail.com>2012-03-28 20:21:46 -0400
commit18d275ada1b23bf07cc51a815385afac6bb2b8cb (patch)
treebecc415730a060480e027c2ef4fabfb33df84b51 /guides/source
parenta0e83d5af7385317fdcc91390e1b3a02b0cf56b8 (diff)
downloadrails-18d275ada1b23bf07cc51a815385afac6bb2b8cb.tar.gz
rails-18d275ada1b23bf07cc51a815385afac6bb2b8cb.tar.bz2
rails-18d275ada1b23bf07cc51a815385afac6bb2b8cb.zip
Make controller namespace partial prefix optional
config.action_view.prefix_partial_path_with_controller_namespace This allows you to choose to render @post using /posts/_post.erb instead of /admin/posts/_post.erb inside Admin::PostsController.
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/configuring.textile11
1 files changed, 9 insertions, 2 deletions
diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile
index 246af587bc..717654d5d8 100644
--- a/guides/source/configuring.textile
+++ b/guides/source/configuring.textile
@@ -354,8 +354,7 @@ h4. Configuring Action Dispatch
h4. Configuring Action View
-There are only a few configuration options for Action View, starting with six on +ActionView::Base+:
-
+<tt>config.action_view</tt> includes a small number of configuration settings:
* +config.action_view.field_error_proc+ provides an HTML generator for displaying errors that come from Active Record. The default is
@@ -397,6 +396,14 @@ And can reference in the view with the following code:
* +config.action_view.embed_authenticity_token_in_remote_forms+ allows you to set the default behavior for +authenticity_token+ in forms with +:remote => true+. By default it's set to false, which means that remote forms will not include +authenticity_token+, which is helpful when you're fragment-caching the form. Remote forms get the authenticity from the +meta+ tag, so embedding is unnecessary unless you support browsers without JavaScript. In such case you can either pass +:authenticity_token => true+ as a form option or set this config setting to +true+
+* +config.action_view.prefix_partial_path_with_controller_namespace+ determines whether or not partials are looked up from a subdirectory in templates rendered from namespaced controllers. For example, consider a controller named +Admin::PostsController+ which renders this template:
+
+<erb>
+<%= render @post %>
+<erb>
+
+The default setting is +true+, which uses the partial at +/admin/posts/_post.erb+. Setting the value to +false+ would render +/posts/_post.erb+, which is the same behavior as rendering from a non-namespaced controller such as +PostsController+.
+
h4. Configuring Action Mailer
There are a number of settings available on +config.action_mailer+: