diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-26 16:17:58 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-26 16:17:58 -0500 |
commit | 6ec07e0737c3099056fc11fe43f4f19dde3770a6 (patch) | |
tree | 7911a26c4ed148c706951a301a1ebdc2e46af8e2 /actionpack/lib/action_view/base.rb | |
parent | cd91a8d3adb70e573ab8d0d733a966db5eff1e1d (diff) | |
download | rails-6ec07e0737c3099056fc11fe43f4f19dde3770a6.tar.gz rails-6ec07e0737c3099056fc11fe43f4f19dde3770a6.tar.bz2 rails-6ec07e0737c3099056fc11fe43f4f19dde3770a6.zip |
Store application and other context specific helper modules in ActionView::Base#helpers
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index d174c784f3..c65048bfa0 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -208,10 +208,24 @@ module ActionView #:nodoc: ActionView::PathSet.new(Array(value)) end + attr_reader :helpers + + class ProxyModule < Module + def initialize(receiver) + @receiver = receiver + end + + def include(*args) + super(*args) + @receiver.extend(*args) + end + end + def initialize(view_paths = [], assigns_for_first_render = {}, controller = nil)#:nodoc: @assigns = assigns_for_first_render @assigns_added = nil @controller = controller + @helpers = ProxyModule.new(self) self.view_paths = view_paths end |