aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosh Peek <josh@joshpeek.com>2008-04-06 18:42:34 +0000
committerJosh Peek <josh@joshpeek.com>2008-04-06 18:42:34 +0000
commit917423d664038d6791738a73ad1446437dbb71df (patch)
treebda3e8810f16831767e69102db409152695ea523 /actionpack/lib/action_controller
parent5b822aca4b6524c9147224764ec0f20a728ba2a1 (diff)
downloadrails-917423d664038d6791738a73ad1446437dbb71df.tar.gz
rails-917423d664038d6791738a73ad1446437dbb71df.tar.bz2
rails-917423d664038d6791738a73ad1446437dbb71df.zip
Provide a helper proxy to access helper methods from outside views. Closes #10839 [Josh Peek]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9234 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/helpers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/helpers.rb b/actionpack/lib/action_controller/helpers.rb
index 81b8ff9753..9188f94f37 100644
--- a/actionpack/lib/action_controller/helpers.rb
+++ b/actionpack/lib/action_controller/helpers.rb
@@ -167,6 +167,15 @@ module ActionController #:nodoc:
attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
end
+ # Provides a proxy to access helpers methods from outside the view.
+ def helpers
+ unless @helper_proxy
+ @helper_proxy = ActionView::Base.new
+ @helper_proxy.extend master_helper_module
+ else
+ @helper_proxy
+ end
+ end
private
def default_helper_module!