Ruby on rails 设备中的命名错误::会话控制器#新
我刚刚在rails api应用程序中安装了Desive。我已将以下内容添加到我的ApplicationController中:Ruby on rails 设备中的命名错误::会话控制器#新,ruby-on-rails,devise,rails-api,Ruby On Rails,Devise,Rails Api,我刚刚在rails api应用程序中安装了Desive。我已将以下内容添加到我的ApplicationController中: include AbstractController::Layouts include ActionController::MimeResponds include ActionController::HttpAuthentication::Basic::ControllerMethods include ActionController::MimeResponds
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
(受Desive保护)我看到了错误:
设备中的命名错误::会话控制器#新增{}的未定义方法“permit”:哈希
跟踪指向此处:
devise (3.1.1) lib/devise/parameter_sanitizer.rb:50:in `sign_in'
不确定我需要包括什么,以便Desive知道该“许可”方法是什么/在哪里
提前感谢您的帮助。太感谢我了,似乎您也必须添加
strong\u参数
gem,因为您使用的是rails\u api
,因为designe 3.1.1默认用于rails 4,而strong参数默认添加到rails 4中