1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Allow controllers to be given as symbols.

This commit is contained in:
José Valim 2011-04-25 10:00:28 +02:00
parent 4a3ad7f348
commit b1a27ad633
2 changed files with 2 additions and 1 deletions

View file

@ -58,6 +58,7 @@ module Devise
mod = options[:module] || "devise" mod = options[:module] || "devise"
@controllers = Hash.new { |h,k| h[k] = "#{mod}/#{k}" } @controllers = Hash.new { |h,k| h[k] = "#{mod}/#{k}" }
@controllers.merge!(options[:controllers] || {}) @controllers.merge!(options[:controllers] || {})
@controllers.each { |k,v| @controllers[k] = v.to_s }
@path_names = Hash.new { |h,k| h[k] = k.to_s } @path_names = Hash.new { |h,k| h[k] = k.to_s }
@path_names.merge!(:registration => "") @path_names.merge!(:registration => "")

View file

@ -19,7 +19,7 @@ Rails.application.routes.draw do
match "/sign_in", :to => "devise/sessions#new" match "/sign_in", :to => "devise/sessions#new"
# Admin scope # Admin scope
devise_for :admin, :path => "admin_area", :controllers => { :sessions => "admins/sessions" }, :skip => :passwords devise_for :admin, :path => "admin_area", :controllers => { :sessions => :"admins/sessions" }, :skip => :passwords
match "/admin_area/home", :to => "admins#index", :as => :admin_root match "/admin_area/home", :to => "admins#index", :as => :admin_root
match "/anywhere", :to => "foo#bar", :as => :new_admin_password match "/anywhere", :to => "foo#bar", :as => :new_admin_password