私のアプリケーションには、ユーザー、雇用者、監査人の3つのデバイスモデルがあります。3つすべてを作成し、ユーザーと雇用者の両方でログインできますが、Deviseは監査人用の新しいセッションを作成しません。
Started POST "/auditors/sign_in" for 127.0.0.1 at 2012-10-05 01:41:44 +0200
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"vg1hGiEx3Ly1YRVX1XaWyEkz85lJU/5Ap/TcVo8+xWo=", "auditor"=>{"email"=>"auditor5@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Completed 401 Unauthorized in 0ms
deviseジェネレーターを使用してモデルを作成しました。
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
..他のモデルでも同じように見えます。
ルートは問題ないようです:
devise_for :auditors
devise_for :employers
resources :employers, :only => [:show, :edit, :index, :update, :credit]
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
devise_for :users
devise_for :users, :controllers => { :registrations => "registrations" }
ビューまたはデバイスのセッションコントローラでは何も変更していません。どんなアイデアでも大歓迎です。