0

バンドルの更新後、Activeadmin にログインできません。ログは次のとおりです。許可されていないパラメーターが原因ですか?管理者ログインを機能させるために強力なパラメータを設定する必要がありますか? 私はすでにdevise用のこのコードを持っています:

        def configure_permitted_parameters
          devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password, :remember_me) }
          devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password) }
        end



          Started POST "/admin/login" for 127.0.0.1 at 2013-10-30 22:33:25 +1300
        Processing by ActiveAdmin::Devise::SessionsController#create as HTML
          Parameters: {"utf8"=>"✓", "authenticity_token"=>"MhoM/R/oVfad/iiov2zpqfoJ5XOSLda6rTl/V2cMIZE=", "admin_user"=>{"email"=>"tester@iv.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Login"}
        Completed 401 Unauthorized in 0.6ms
        Processing by ActiveAdmin::Devise::SessionsController#new as HTML
          Parameters: {"utf8"=>"✓", "authenticity_token"=>"MhoM/R/oVfad/iiov2zpqfoJ5XOSLda6rTl/V2cMIZE=", "admin_user"=>{"email"=>"tester@iv.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Login"}
        Unpermitted parameters: email, password, remember_me
          Rendered /home/jcui/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.6.2/app/views/active_admin/devise/shared/_links.erb (0.6ms)
          Rendered /home/jcui/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.6.2/app/views/active_admin/devise/sessions/new.html.erb within layouts/active_admin_logged_out (118.2ms)
        Completed 200 OK in 130.7ms (Views: 129.9ms | ActiveRecord: 0.0ms | Solr: 0.0ms)
4

1 に答える 1

0

デバイスの設定はあなたの にあると思いますApplicationControllerbefore_filterコールを含めましたか?

before_filter :configure_permitted_parameters, if: :devise_controller?

def configure_permitted_parameters
  devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password, :remember_me) }
  devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password) }
end
于 2013-10-30T09:50:19.913 に答える