Skip to content

Commit

Permalink
path_names could be used to customize collection actions too
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
nagybence authored and jeremy committed Aug 9, 2009
1 parent 323f58f commit 250e718
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actionpack/lib/action_controller/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,10 @@ def map_collection_actions(map, resource)
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
Expand Down

0 comments on commit 250e718

Please sign in to comment.