method

map_default_collection_actions

Importance_0
v2.0.3 - Show latest stable - 0 notes - Class: ActionController::Resources
map_default_collection_actions(map, resource) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/resources.rb, line 447
      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
Register or log in to add new notes.