2010-07-02 02:12:00 -04:00
|
|
|
Rails.application.routes.draw do
|
2010-07-07 04:51:14 -04:00
|
|
|
# Resources for testing
|
2010-06-29 15:41:34 -04:00
|
|
|
resources :users, :only => [:index] do
|
2010-02-16 10:11:30 -05:00
|
|
|
get :expire, :on => :member
|
2010-06-29 15:41:34 -04:00
|
|
|
get :accept, :on => :member
|
2010-02-16 10:11:30 -05:00
|
|
|
end
|
|
|
|
|
2010-02-17 07:15:19 -05:00
|
|
|
resources :admins, :only => [:index]
|
|
|
|
|
2010-07-07 04:51:14 -04:00
|
|
|
# Users scope
|
|
|
|
devise_for :users do
|
|
|
|
match "/devise_for/sign_in", :to => "devise/sessions#new"
|
|
|
|
end
|
|
|
|
|
|
|
|
as :user do
|
|
|
|
match "/as/sign_in", :to => "devise/sessions#new"
|
|
|
|
end
|
|
|
|
|
|
|
|
match "/sign_in", :to => "devise/sessions#new"
|
|
|
|
|
|
|
|
# Admin scope
|
2010-09-26 15:11:28 -04:00
|
|
|
devise_for :admin, :path => "admin_area", :controllers => { :sessions => "admins/sessions" }, :skip => :passwords
|
2010-06-30 06:41:44 -04:00
|
|
|
|
2010-07-07 04:51:14 -04:00
|
|
|
match "/admin_area/home", :to => "admins#index", :as => :admin_root
|
|
|
|
match "/anywhere", :to => "foo#bar", :as => :new_admin_password
|
|
|
|
|
|
|
|
authenticate(:admin) do
|
|
|
|
match "/private", :to => "home#private", :as => :private
|
|
|
|
end
|
|
|
|
|
|
|
|
# Other routes for routing_test.rb
|
2010-09-26 15:11:28 -04:00
|
|
|
namespace :publisher, :path_names => { :sign_in => "i_dont_care", :sign_out => "get_out" } do
|
2010-07-04 05:53:12 -04:00
|
|
|
devise_for :accounts, :class_name => "User", :path_names => { :sign_in => "get_in" }
|
|
|
|
end
|
|
|
|
|
2010-06-30 06:41:44 -04:00
|
|
|
scope ":locale" do
|
|
|
|
devise_for :accounts, :singular => "manager", :class_name => "User",
|
|
|
|
:path_names => {
|
|
|
|
:sign_in => "login", :sign_out => "logout",
|
|
|
|
:password => "secret", :confirmation => "verification",
|
|
|
|
:unlock => "unblock", :sign_up => "register",
|
2010-07-15 15:58:35 -04:00
|
|
|
:registration => "management", :cancel => "giveup"
|
2010-06-30 06:41:44 -04:00
|
|
|
}
|
|
|
|
end
|
2009-10-12 20:49:51 -04:00
|
|
|
|
2010-09-26 15:11:28 -04:00
|
|
|
namespace :sign_out_via, :module => "devise" do
|
|
|
|
devise_for :deletes, :sign_out_via => :delete, :class_name => "User"
|
|
|
|
devise_for :posts, :sign_out_via => :post, :class_name => "User"
|
|
|
|
devise_for :delete_or_posts, :sign_out_via => [:delete, :post], :class_name => "User"
|
2010-08-12 17:46:00 -04:00
|
|
|
end
|
|
|
|
|
2010-07-15 15:58:35 -04:00
|
|
|
match "/set", :to => "home#set"
|
2010-02-17 07:15:19 -05:00
|
|
|
root :to => "home#index"
|
|
|
|
end
|