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"
@controllers = Hash.new { |h,k| h[k] = "#{mod}/#{k}" }
@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.merge!(:registration => "")

View File

@ -19,7 +19,7 @@ Rails.application.routes.draw do
match "/sign_in", :to => "devise/sessions#new"
# 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 "/anywhere", :to => "foo#bar", :as => :new_admin_password