Method: ActionDispatch::Routing::Mapper::Base#match

Defined in:
lib/action_dispatch/routing/mapper.rb

#match(path, options = nil) ⇒ Object

When you set up a regular route, you supply a series of symbols that Rails maps to parts of an incoming HTTP request.

match ':controller/:action/:id/:user_id'

Two of these symbols are special: :controller maps to the name of a controller in your application, and :action maps to the name of an action within that controller. Anything other than :controller or :action will be available to the action as part of params.



271
272
273
274
275
# File 'lib/action_dispatch/routing/mapper.rb', line 271

def match(path, options=nil)
  mapping = Mapping.new(@set, @scope, path, options || {}).to_route
  @set.add_route(*mapping)
  self
end