Sha256: 73fafefb3efa375d81f9282a4c1a6a801c828f888b427a72ed906a0bd46b7d1c

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

# Merb::Router is the request routing mapper for the merb framework.
#
# You can route a specific URL to a controller / action pair:
#
#   r.match("/contact").
#     to(:controller => "info", :action => "contact")
#
# You can define placeholder parts of the url with the :symbol notation. These
# placeholders will be available in the params hash of your controllers. For example:
#
#   r.match("/books/:book_id/:action").
#     to(:controller => "books")
#   
# Or, use placeholders in the "to" results for more complicated routing, e.g.:
#
#   r.match("/admin/:module/:controller/:action/:id").
#     to(:controller => ":module/:controller")
#
# You can also use regular expressions, deferred routes, and many other options.
# See merb/specs/merb/router.rb for a fairly complete usage sample.

puts "Compiling routes.."
Merb::Router.prepare do |r|
  # RESTful routes
  # r.resources :posts

  # This is the default route for /:controller/:action/:id
  # This is fine for most cases.  If you're heavily using resource-based
  # routes, you may want to comment/remove this line to prevent
  # clients from calling your create or destroy actions with a GET
  r.default_routes
  
  # Change this for your home page to be available at /
  # r.match('/').to(:controller => 'whatever', :action =>'index')
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-0.4.1 app_generators/merb/templates/config/router.rb
merb-0.4.2 app_generators/merb/templates/config/router.rb
merb-0.5.0 app_generators/merb/templates/config/router.rb
merb-0.5.1 app_generators/merb/templates/config/router.rb
merb-0.5.2 app_generators/merb/templates/config/router.rb
merb-0.5.3 app_generators/merb/templates/config/router.rb