Skip to content

Instantly share code, notes, and snippets.

@piclez
Created September 22, 2008 17:23
Show Gist options
  • Save piclez/12058 to your computer and use it in GitHub Desktop.
Save piclez/12058 to your computer and use it in GitHub Desktop.
Merb::Router.prepare do |r|
#Merbauth routes is broken (capture is depricated)
slice(:MerbAuth, :path => "", :default_routes => false)
# 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 => 'welcome', :action =>'index')
# AIR
with(:controller => 'galleries') do
match('/upload').to(:action =>'upload', :method => 'post')
match('/galleries.xml').to(:action =>'get_user_galleries', :method => 'get', :format => "xml")
end
# AIR - This was temporary added to the merb-auth gem
match('/login_xml').to(:controller => 'dashboard', :action =>'login_xml').name(:login_xml)
match("/:login") do
resources :galleries
to(:controller =>'dashboard', :method => 'get').name(:user)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment