Sha256: cccdc06f5b54e8029861deabda805891aa483cf11a3bab97066ea673d3dd0aa1

Contents?: true

Size: 940 Bytes

Versions: 3

Compression:

Stored size: 940 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|
  r.add '/foo/:bar/baz/:id', :controller => 'Test', :action => 'foo'
  r.add '/bar/:bar_id/baz/:id', :controller => 'Test', :action => 'foo'
  r.add '/:controller/:action/:id'
  r.add '/bar/:*rest', :controller => 'Test', :action => 'glob'
  r.add '', :controller => 'posts', :action =>'index'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
merb-0.0.5 examples/sample_app/dist/conf/router.rb
merb-0.0.6 examples/sample_app/dist/conf/router.rb
merb-0.0.7 examples/sample_app/dist/conf/router.rb