path_names could be used to customize collection actions too

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Bence Nagy
2008-12-27 23:28:37 +01:00
committed by Jeremy Kemper
parent 1fc1986d6d
commit e1b73b9752

View File

@@ -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