Skip to content

Instantly share code, notes, and snippets.

@lukesutton
Created September 23, 2008 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lukesutton/12185 to your computer and use it in GitHub Desktop.
Save lukesutton/12185 to your computer and use it in GitHub Desktop.
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
# Administration
match('/admin').to(:namespace => "admin") do
resources :locations
resources :users
resources :links
match("/offer").to(:controller => "offer") do
match(:method => "get").to(:action => "show").name(:offer)
match("/edit", :method => "get").to(:action => "edit").name(:edit_offer)
match(:method => "post").to(:action => "update")
end
slice(:MerbAuth)
end
# Redirect from admin root to locations
match("/admin").redirect("/admin/locations")
# Public resources
match(%r{\/data\/hotspots(\.:format)?$}).to(:controller => "public/locations", :action => "index")
match('/tightarse', :method => :post).to(:controller => "public/contact", :action => "tightarse")
match('/contact_us', :method => :post).to(:controller => "public/contact", :action => "contact_us")
match('/campaigns/:image').to(:controller => "public/campaigns", :action => "show")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment