-
-
Save bsodmike/853648860510190b20bb to your computer and use it in GitHub Desktop.
Attempted solution to http://stackoverflow.com/questions/5984850/how-to-achieve-a-separated-admin-namespaced-or-scoped-with-two-devise-models-u
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match 'admin', :controller => 'admin' | |
namespace :admin do | |
# to be updated later... | |
end | |
devise_for :users | |
#devise_for :admins, :path => "admin" # this works but uses the default | |
# Devise::SessionController | |
devise_for :admins, | |
:controllers => { | |
:sessions => "admin/sessions", | |
:passwords => "admin/passwords", | |
:registrations => "admin/registrations" }, :path => "admin", | |
:skip => [:sessions, :passwords, :registrations] do | |
get 'admin/sign_in' => 'admin/sessions#new', :as => :new_admin_session | |
post 'admin/sign_in' => 'admin/sessions#create', :as => :admin_session | |
get 'admin/sign_out' => 'admin/sessions#destroy', :as => :destroy_admin_session | |
get 'admin/sign_up' => 'admin/registrations#new', :as => :new_admin_registration | |
get 'admin/account' => 'admin/registrations#edit', :as => :edit_admin_registration | |
post 'admin/account' => 'admin/registrations#create', :as => :admin_registration | |
get 'admin/cancel' => 'admin/registrations#cancel', :as => :cancel_admin_registration | |
put 'admin/account' => 'admin/registrations#update' | |
delete 'admin/account' => 'admin/registrations#destroy' | |
post 'admin/password' => 'admin/passwords#create', :as => :admin_password | |
get 'admin/password/new' => 'admin/passwords#new', :as => :new_admin_password | |
get 'admin/password/edit' => 'admin/passwords#edit', :as => :edit_admin_password | |
put 'admin/password' => 'admin/passwords#update' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment