[英]ArgumentError in ActiveAdmin::Devise::SessionsController#create
I installed ActiveAdmin and log in with default admin name and password, while there is an error and hope somebody can help me with it. 我安装了ActiveAdmin并使用默认的管理员名称和密码登录,但有一个错误,希望有人可以帮助我。 Thanks !
谢谢 !
Here is the error: 这是错误:
ArgumentError in ActiveAdmin::Devise::SessionsController#create
wrong number of arguments (2 for 1)
Rails.root: E:/Ruby/challenger2 - Copy
Application Trace | Framework Trace | Full Trace
app/helpers/sessions_helper.rb:2:in `sign_in'
Part of the sessions_helper.rb file: sessions_helper.rb文件的一部分:
module SessionsHelper
def sign_in(user)
self.current_user = user
end
def current_user=(user)
@current_user = user
end
def current_user
@current_user ||= user_from_remember_token
end
def signed_in?
!current_user.nil?
end
end
gem Devise, which Active Admin depends on, probably use "sign_in" function - this name has one of members function of your SessionsHelper module. Active Admin依赖的gem Devise可能使用“sign_in”函数 - 这个名称具有SessionsHelper模块的成员函数之一。 this cause invoke of wrong function.
这导致调用错误的函数。 one solution is not to use activeadmin as an admin tool ))) and the other one is to rename "sign_in" function globally to "sign_in_" for example
一个解决方案不是使用activeadmin作为管理工具)))而另一个解决方案是将“sign_in”函数全局重命名为“sign_in_”,例如
and don't forget to restart server: it helps from time to time ) 并且不要忘记重新启动服务器:它不时帮助)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.