Skip to content

Instantly share code, notes, and snippets.

@andreierdoss
Created March 25, 2009 21:59
Show Gist options
  • Save andreierdoss/85748 to your computer and use it in GitHub Desktop.
Save andreierdoss/85748 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.resources :users
map.resource :session
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.signup '/signup', :controller => 'users', :action => 'new'
map.forgot '/forgot', :controller => 'users', :action => 'forgot'
map.denied '/denied', :controller => 'authorization', :action => 'denied'
map.reset '/reset/:reset_code', :controller => 'users', :action => 'reset'
map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate'
map.resend_activation '/resend_activation', :controller => 'users', :action => 'resend_activation'
map.namespace(:admin) do |admin|
admin.resources :users
end
map.namespace(:member) do |member|
member.with_options(:controller => 'users') do |user|
user.my_account '/account', :action => 'my_account'
user.destroy_account '/destroy', :action => 'destroy'
user.change_password '/change_password', :action => 'change_password', :conditions => { :method => :post }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment