diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 14:16:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 14:16:05 +0000 |
commit | 75157bbf64571548983892e62fab5789e9ab06d0 (patch) | |
tree | 30755f6574a4f54eb3e528163ca75d16793fabc1 /actionpack/lib/action_controller | |
parent | afbf54bc3dc8f9d1aeb670d927097a46e78c1515 (diff) | |
download | rails-75157bbf64571548983892e62fab5789e9ab06d0.tar.gz rails-75157bbf64571548983892e62fab5789e9ab06d0.tar.bz2 rails-75157bbf64571548983892e62fab5789e9ab06d0.zip |
Fixed that named routes didn't use the default values for action and possible other parameters #1534 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 940136efd0..d69c862989 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -256,13 +256,14 @@ module ActionController class Route #:nodoc: attr_accessor :components, :known - attr_reader :path, :options, :keys + attr_reader :path, :options, :keys, :defaults def initialize(path, options = {}) @path, @options = path, options initialize_components path defaults, conditions = initialize_hashes options.dup + @defaults = defaults.dup configure_components(defaults, conditions) initialize_keys end @@ -576,7 +577,7 @@ module ActionController end def name_route(route, name) - hash = route.known.symbolize_keys + hash = route.defaults.merge(route.known).symbolize_keys hash[:controller] = "/#{hash[:controller]}" define_method(hash_access_name(name)) { hash } |