Sha256: f0b17254861507f678549793bfcd569c85fa356774f8e0d827cd29b465a25dac

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 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: \n"
Merb::RouteMatcher.prepare do |r|
  r.add '/:controller/:action/:id'
  #r.add '', :controller => 'SomeController', :action =>'foo'
end

m = Merb::RouteMatcher.new
puts m.compiled_statement

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb-0.0.8 examples/app_skeleton/dist/conf/router.rb