Changeset 9234
- Timestamp:
- 04/06/08 18:42:34 (8 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/helpers.rb (modified) (1 diff)
- trunk/actionpack/test/controller/helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r9226 r9234 1 1 *SVN* 2 3 * Provide a helper proxy to access helper methods from outside views. Closes #10839 [Josh Peek] 4 e.g. ApplicationController.helpers.simple_format(text) 2 5 3 6 * Improve documentation. [Xavier Noria, leethal, jerome] trunk/actionpack/lib/action_controller/helpers.rb
r8409 r9234 168 168 end 169 169 170 # Provides a proxy to access helpers methods from outside the view. 171 def helpers 172 unless @helper_proxy 173 @helper_proxy = ActionView::Base.new 174 @helper_proxy.extend master_helper_module 175 else 176 @helper_proxy 177 end 178 end 170 179 171 180 private trunk/actionpack/test/controller/helper_test.rb
r8985 r9234 131 131 end 132 132 133 def test_helper_proxy 134 methods = ApplicationController.helpers.methods.map(&:to_s) 135 136 # ActionView 137 assert methods.include?('pluralize') 138 139 # abc_helper.rb 140 assert methods.include?('bare_a') 141 142 # fun/games_helper.rb 143 assert methods.include?('stratego') 144 145 # fun/pdf_helper.rb 146 assert methods.include?('foobar') 147 end 148 133 149 private 134 150 def expected_helper_methods