diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-08-04 16:20:56 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:12 +0200 |
commit | f3c703a32f6c7833705e46b8e14f172330a1c916 (patch) | |
tree | 6f32bb77743e3d5de9205fe7190cc2fe1448c8a4 /actionpack/lib/action_dispatch/routing | |
parent | 434139f89fd2ec550b8c5ab1309e5a8af06142d7 (diff) | |
download | rails-f3c703a32f6c7833705e46b8e14f172330a1c916.tar.gz rails-f3c703a32f6c7833705e46b8e14f172330a1c916.tar.bz2 rails-f3c703a32f6c7833705e46b8e14f172330a1c916.zip |
Refactor RoutesProxy to avoid using _with_routes in helpers
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/url_for.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 219fa37fcb..363bcbd2b0 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -307,7 +307,7 @@ module ActionDispatch routes = self MountedHelpers.class_eval do define_method "_#{name}" do - RoutesProxy.new(routes, self) + RoutesProxy.new(routes, self._routes_context) end end diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index 19db730b6a..e836cf7c8e 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -141,6 +141,10 @@ module ActionDispatch ensure @_routes = old_routes end + + def _routes_context + self + end end end end |