Sha256: 8cae9ffa92c5d6051744baf9e7b45cf36f111c1cef17fc712ba4ddf38365a8ec

Contents?: true

Size: 1.43 KB

Versions: 7

Compression:

Stored size: 1.43 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

  r.match( '/' ).to( :controller => "moled", :action => 'index' )
  r.match( '/moled/my_action/:id' ).to( :controller => "moled", :action => 'my_action' )
  
  # 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

7 entries across 7 versions & 2 rubygems

Version Path
derailed-mole-1.0.10 samples/merbapp/config/router.rb
mole-1.0.6 samples/merbapp/config/router.rb
mole-1.0.7 samples/merbapp/config/router.rb
mole-1.0.11 samples/merbapp/config/router.rb
mole-1.0.12 samples/merbapp/config/router.rb
mole-1.0.8 samples/merbapp/config/router.rb
mole-1.0.9 samples/merbapp/config/router.rb