0
@@ -238,8 +238,9 @@ module ActionController
0
# The +resources+ method accepts the following options to customize the resulting routes:
0
# * <tt>:collection</tt> - Add named routes for other actions that operate on the collection.
0
- # Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>
0
- # or <tt>:any</tt> if the method does not matter. These routes map to a URL like /messages/rss, with a route of +rss_messages_url+.
0
+ # Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>,
0
+ # an array of any of the previous, or <tt>:any</tt> if the method does not matter.
0
+ # These routes map to a URL like /messages/rss, with a route of +rss_messages_url+.
0
# * <tt>:member</tt> - Same as <tt>:collection</tt>, but for actions that operate on a specific member.
0
# * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new resource action.
0
# * <tt>:controller</tt> - Specify the controller name for the routes.
0
@@ -480,8 +481,10 @@ module ActionController
0
def map_collection_actions(map, resource)
0
resource.collection_methods.each do |method, actions|
0
actions.each do |action|
0
- action_options = action_options_for(action, resource, method)
0
- map_named_routes(map, "#{action}_#{resource.name_prefix}#{resource.plural}", "#{resource.path}#{resource.action_separator}#{action}", action_options)
0
+ [method].flatten.each do |m|
0
+ action_options = action_options_for(action, resource, m)
0
+ map_named_routes(map, "#{action}_#{resource.name_prefix}#{resource.plural}", "#{resource.path}#{resource.action_separator}#{action}", action_options)
0
@@ -521,12 +524,14 @@ module ActionController
0
def map_member_actions(map, resource)
0
resource.member_methods.each do |method, actions|
0
actions.each do |action|
0
- action_options = action_options_for(action, resource, method)
0
+ [method].flatten.each do |m|
0
+ action_options = action_options_for(action, resource, m)
0
- action_path = resource.options[:path_names][action] if resource.options[:path_names].is_a?(Hash)
0
- action_path ||= Base.resources_path_names[action] || action
0
+ action_path = resource.options[:path_names][action] if resource.options[:path_names].is_a?(Hash)
0
+ action_path ||= Base.resources_path_names[action] || action
0
- map_named_routes(map, "#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}#{resource.action_separator}#{action_path}", action_options)
0
+ map_named_routes(map, "#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}#{resource.action_separator}#{action_path}", action_options)