Skip to content

Instantly share code, notes, and snippets.

@phurley
Created December 11, 2008 01:54
Show Gist options
  • Save phurley/34570 to your computer and use it in GitHub Desktop.
Save phurley/34570 to your computer and use it in GitHub Desktop.
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
match('/').to(:controller => "static", :action => "index").name(:front)
match('/demo').to(:controller => "static", :action => "demo").name(:demo)
match('/register').to(:controller => "user", :action => "new").name(:register)
match('static/foo').to(:controller => "static", :action => "foo").name(:foo)
# RESTful routes
resources :tournaments
# resources :posts
# Adds the required routes for merb-auth using the password slice
slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
# 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
default_routes
# Change this for your home page to be available at /
# match('/').to(:controller => 'whatever', :action =>'index')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment