Class | ActionController::Routing::RouteSet::Mapper
In: | lib/action_controller/routing/route_set.rb
Parent: | Object

Mapper instances are used to build routes. The object passed to the draw block in config/routes.rb is a Mapper instance.

Mapper instances have relatively few instance methods, in order to avoid clashes with named routes.

### Methods

connect namespace root

### Included Modules

ActionController::Resources

### Public Instance methods

connect(path, options = {})

Create an unnamed route with the provided `path` and `options`. See ActionController::Routing for an introduction to routes.

namespace(name, options = {}, &block)

Enables the use of resources in a module by setting the name_prefix, path_prefix, and namespace for the model. Example:

      map.namespace(:admin) do |admin|
        admin.resources :products,
          :has_many => [ :tags, :images, :variants ]
      end

This will create `admin_products_url` pointing to "admin/products", which will look for an Admin::ProductsController. It‘ll also create `admin_product_tags_url` pointing to "admin/products/#{product_id}/tags", which will look for Admin::TagsController.

root(options = {})

Creates a named route called "root" for matching the root level request.

[Validate]