aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/rendering.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-10-26 14:27:18 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2010-10-26 14:27:18 +0100
commit4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8 (patch)
tree1ed823580f576b96d747febd507442d053c55f40 /actionpack/lib/abstract_controller/rendering.rb
parentc40074c1c7253f89ca9daf69b1a61068a478f144 (diff)
downloadrails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.tar.gz
rails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.tar.bz2
rails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.zip
Allow generated url helpers to be overriden [#5243 state:resolved]
Diffstat (limited to 'actionpack/lib/abstract_controller/rendering.rb')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index 1c63fb2d14..475785a4b4 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -46,14 +46,14 @@ module AbstractController
@view_context_class ||= begin
controller = self
Class.new(ActionView::Base) do
+ if controller.respond_to?(:_routes) && controller._routes
+ include controller._routes.url_helpers
+ include controller._routes.mounted_helpers
+ end
+
if controller.respond_to?(:_helpers)
include controller._helpers
- if controller.respond_to?(:_routes) && controller._routes
- include controller._routes.url_helpers
- include controller._routes.mounted_helpers
- end
-
# TODO: Fix RJS to not require this
self.helpers = controller._helpers
end