aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/base.rb
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 /actionpack/lib/action_view/base.rb
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 'actionpack/lib/action_view/base.rb')
-rw-r--r--actionpack/lib/action_view/base.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 23329d7f35..056dbc9529 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -141,6 +141,12 @@ module ActionView #:nodoc:
cattr_accessor :streaming_completion_on_exception
@@streaming_completion_on_exception = %("><script type="text/javascript">window.location = "/500.html"</script></html>)
+ # Specify whether rendering within namespaced controllers should prefix
+ # the partial paths for ActiveModel objects with the namespace.
+ # (e.g., an Admin::PostsController would render @post using /admin/posts/_post.erb)
+ cattr_accessor :prefix_partial_path_with_controller_namespace
+ @@prefix_partial_path_with_controller_namespace = true
+
class_attribute :helpers
class_attribute :_routes
class_attribute :logger