Permalink
Browse files

For view_context we need to initialize RoutesProxy in context of cont…

…roller, not view, quick fix, I need to dig into it later
  • Loading branch information...
1 parent 8fdeff0 commit 99131939316230065b4297573d080d1585e4e5a7 @drogus drogus committed Jul 31, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -301,11 +301,13 @@ def mounted_helpers(name = nil)
MountedHelpers
end
- def define_mounted_helper(name, helpers = nil)
+ def define_mounted_helper(name)
+ return if MountedHelpers.method_defined?(name)
+
routes = self
MountedHelpers.class_eval do
define_method "_#{name}" do
- RoutesProxy.new(routes, self)
+ RoutesProxy.new(routes, (self.respond_to?(:controller) ? controller : self))
end
end

0 comments on commit 9913193

Please sign in to comment.