method
map_default_collection_actions
v2.1.0 -
Show latest stable
- Class:
ActionController::Resources
map_default_collection_actions(map, resource)private
No documentation available.
# File actionpack/lib/action_controller/resources.rb, line 486
def map_default_collection_actions(map, resource)
index_action_options = action_options_for("index", resource)
index_route_name = "#{resource.name_prefix}#{resource.plural}"
if resource.uncountable?
index_route_name << "_index"
end
map.named_route(index_route_name, resource.path, index_action_options)
map.named_route("formatted_#{index_route_name}", "#{resource.path}.:format", index_action_options)
create_action_options = action_options_for("create", resource)
map.connect(resource.path, create_action_options)
map.connect("#{resource.path}.:format", create_action_options)
end