diff options
author | Bence Nagy <nagybence@tipogral.hu> | 2008-12-27 23:28:37 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-09 14:26:36 -0700 |
commit | e1b73b975264c622f692a46eec060ff35a588d96 (patch) | |
tree | 1145c7f3d74816e7130fa1e96b056b53ebec2c14 /actionpack/lib/action_controller | |
parent | 1fc1986d6deacd71ec4bea2287d9cfed6123b898 (diff) | |
download | rails-e1b73b975264c622f692a46eec060ff35a588d96.tar.gz rails-e1b73b975264c622f692a46eec060ff35a588d96.tar.bz2 rails-e1b73b975264c622f692a46eec060ff35a588d96.zip |
path_names could be used to customize collection actions too
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/routing/resources.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing/resources.rb b/actionpack/lib/action_controller/routing/resources.rb index 2dee0a3d87..c1ebd46b48 100644 --- a/actionpack/lib/action_controller/routing/resources.rb +++ b/actionpack/lib/action_controller/routing/resources.rb @@ -589,7 +589,10 @@ module ActionController resource.collection_methods.each do |method, actions| actions.each do |action| [method].flatten.each do |m| - map_resource_routes(map, resource, action, "#{resource.path}#{resource.action_separator}#{action}", "#{action}_#{resource.name_prefix}#{resource.plural}", m) + action_path = resource.options[:path_names][action] if resource.options[:path_names].is_a?(Hash) + action_path ||= action + + map_resource_routes(map, resource, action, "#{resource.path}#{resource.action_separator}#{action_path}", "#{action}_#{resource.name_prefix}#{resource.plural}", m) end end end |