aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-02-25 15:05:10 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-02-25 17:53:01 -0800
commit36fd9efb5e4bfc9ac3acd4189d4dc457dea8102a (patch)
treeee50b242b16d4d4a5c98a2d48f5b0af2d46e5ce0 /actionpack/lib/action_dispatch/routing/route_set.rb
parent9a5be2e5a80ab9e74294f32cfef58fbbcd9b637c (diff)
downloadrails-36fd9efb5e4bfc9ac3acd4189d4dc457dea8102a.tar.gz
rails-36fd9efb5e4bfc9ac3acd4189d4dc457dea8102a.tar.bz2
rails-36fd9efb5e4bfc9ac3acd4189d4dc457dea8102a.zip
Continued effort to deglobalize the router
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb23
1 files changed, 5 insertions, 18 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 8b761d393f..7bfe4fa2bf 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -194,24 +194,11 @@ module ActionDispatch
# end
@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
def #{selector}(*args)
- if args.empty? || Hash === args.first
- options = #{hash_access_method}(args.first || {})
- else
- options = #{hash_access_method}(args.extract_options!)
- default = default_url_options(options) if self.respond_to?(:default_url_options, true)
- options = (default ||= {}).merge(options)
-
- keys = #{route.segment_keys.inspect}
- keys -= options.keys if args.size < keys.size - 1 # take format into account
-
- args = args.zip(keys).inject({}) do |h, (v, k)|
- h[k] = v
- h
- end
-
- # Tell url_for to skip default_url_options
- options[:use_defaults] = false
- options.merge!(args)
+ options = #{hash_access_method}(args.extract_options!)
+
+ if args.any?
+ options[:_positional_args] = args
+ options[:_positional_keys] = #{route.segment_keys.inspect}
end
url_for(options)