Sha256: 851eac3580c7726bd77abc85720ada639b6e895992a9477e9f8afed17ebf0c7f

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

Contents

# Merb::RouteMatcher is the request routing mapper for the merb framework.
# You can define placeholder parts of the url with the :smbol notation.
# so r.add '/foo/:bar/baz/:id', :class => 'Bar', :method => 'foo'
# will match against a request to /foo/123/baz/456. It will then
# use the class Bar as your merb controller and call the foo method on it. 
# the foo method will recieve a hash with {:bar => '123', :id => '456'}
# as the content. So the :placeholders sections of your routes become
# a hash of arguments to your controller methods.
# The default route is installed 


puts "Compiling routes.."
Merb::RouteMatcher.prepare do |r|
  # restfull routes
  # r.resources :posts

  # default route, usually you don't want to change this
  r.default_routes
  
  # change this for your home page to be avaiable at /
  #r.add '/', :controller => 'whatever', :action =>'index'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
merb-0.3.0 examples/skeleton/dist/conf/router.rb
merb-0.3.1 examples/skeleton/dist/conf/router.rb