diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-25 10:08:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-30 10:24:57 -0800 |
commit | 532e12287eb9b14583d2f97262f244fc28de6f24 (patch) | |
tree | ebab551058f87a9b4e83b5f88b3b09915fff6f89 /actionpack/lib/action_dispatch | |
parent | 621ca05ae40c3d27b12d1681ebe049fcf18bc213 (diff) | |
download | rails-532e12287eb9b14583d2f97262f244fc28de6f24.tar.gz rails-532e12287eb9b14583d2f97262f244fc28de6f24.tar.bz2 rails-532e12287eb9b14583d2f97262f244fc28de6f24.zip |
moving more stuff to the instance
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 65d4865baf..8a78e49071 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -169,15 +169,16 @@ module ActionDispatch # class UrlHelper def self.create(route, options) - new options + new route, options end - def initialize(options) + def initialize(route, options) @options = options + @segment_keys = route.segment_keys end - def url_else(t, args, seg) - t.url_for(handle_positional_args(t, args, @options, seg)) + def url_else(t, args) + t.url_for(handle_positional_args(t, args, @options, @segment_keys)) end def url_if(t, path) @@ -218,7 +219,6 @@ module ActionDispatch ohelp = optimize_helper?(route) ohelper = optimized_helper(route) arg_size = route.required_parts.size - segment_keys = route.segment_keys helper = UrlHelper.create(route, options.dup) @@ -227,7 +227,7 @@ module ActionDispatch if ohelp && args.size == arg_size && !args.last.is_a?(Hash) && optimize_routes_generation? helper.url_if(self, eval("\"#{ohelper}\"")) else - helper.url_else(self, args, segment_keys) + helper.url_else(self, args) end end end |