Sha256: 41c5496e80046460863f265bc4c3041a410724555efb11226aca9867efdfd1c0

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

# encoding: utf-8

# Rango::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.

Rango.logger.info("Compiling routes...")
Rango::Router.prepare do |r|
  # RESTful routes
  # r.resources :posts
  resources :fake_models
  resources :obj
  resources :models

  # 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

4 entries across 4 versions & 1 rubygems

Version Path
rango-0.1.0 spec/rango/helpers/merb-helpers/fixture/config/router.rb
rango-0.0.6 spec/rango/helpers/merb-helpers/fixture/config/router.rb
rango-0.1.pre spec/rango/helpers/merb-helpers/fixture/config/router.rb
rango-0.0.4 spec/rango/helpers/merb-helpers/fixture/config/router.rb