aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-03-09 21:20:13 -0600
committerJoshua Peek <josh@joshpeek.com>2010-03-09 21:20:13 -0600
commit1cc2a61ea655fea246f4c3e22a9e4a494e99d952 (patch)
treeb1743dd232046ab122471e1595960d65ac991cb2 /actionpack/lib/action_dispatch/routing/route_set.rb
parent4d2470f7daad8cebd0a69f5ea0509a41af0596b8 (diff)
downloadrails-1cc2a61ea655fea246f4c3e22a9e4a494e99d952.tar.gz
rails-1cc2a61ea655fea246f4c3e22a9e4a494e99d952.tar.bz2
rails-1cc2a61ea655fea246f4c3e22a9e4a494e99d952.zip
Allow default_url_options to be set on route set
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 2b9fc9e0de..26f37161a7 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -186,6 +186,7 @@ module ActionDispatch
attr_accessor :routes, :named_routes
attr_accessor :disable_clear_and_finalize, :resources_path_names
+ attr_accessor :default_url_options
def self.default_resources_path_names
{ :new => 'new', :edit => 'edit' }
@@ -196,6 +197,7 @@ module ActionDispatch
self.named_routes = NamedRouteCollection.new
self.resources_path_names = self.class.default_resources_path_names.dup
self.controller_namespaces = Set.new
+ self.default_url_options = {}
@disable_clear_and_finalize = false
clear!
@@ -404,6 +406,8 @@ module ActionDispatch
RESERVED_OPTIONS = [:anchor, :params, :only_path, :host, :protocol, :port, :trailing_slash, :skip_relative_url_root]
def url_for(options)
+ options = default_url_options.merge(options || {})
+
handle_positional_args(options)
rewritten_url = ""