From ed4cdc9678c9561e127a9b199014309b43a3f858 Mon Sep 17 00:00:00 2001 From: Bence Nagy Date: Sat, 27 Dec 2008 23:28:37 +0100 Subject: [PATCH] :path_names could be used to customize collection actions too --- actionpack/lib/action_controller/resources.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index e8988aa..3bb04f8 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -583,7 +583,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 -- 1.5.6.3