我刚刚在rails-api应用程序中安装了Devise。我已将以下内容添加到ApplicationController中:
include AbstractController::Layouts
include ActionController::MimeResponds
include ActionController::HttpAuthentication::Basic::ControllerMethods
include ActionController::MimeResponds
include ActionController::Cookies
我已将此添加到我的config / application.rb:
config.middleware.use ActionDispatch::Flash
config.middleware.use ActionDispatch::Cookies
config.middleware.use ActionDispatch::Session::CookieStore
当我尝试访问http://localhost:3000/users/sign_in
时(受Devise保护)我看到了错误:
Devise中的NoMethodError :: SessionsController #new
{}的未定义方法`permit':Hash
跟踪指向此处:
devise (3.1.1) lib/devise/parameter_sanitizer.rb:50:in `sign_in'
不确定我需要包含什么才能让Devise知道这种'permit'方法的用途和位置。
提前感谢您的帮助。