Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

path_names could be used to customize collection actions too

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 250e718355287de23604e8171d66138522eddd63 1 parent 323f58f
@nagybence nagybence authored jeremy committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 actionpack/lib/action_controller/resources.rb
View
5 actionpack/lib/action_controller/resources.rb
@@ -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

0 comments on commit 250e718

Please sign in to comment.
Something went wrong with that request. Please try again.