开发者

Model namespace

开发者 https://www.devze.com 2023-02-24 02:16 出处:网络
I have User model with static method authenticate and I use Rubyoverflow gem. In the controller I code:

I have User model with static method authenticate and I use Rubyoverflow gem.

In the controller I code:

User.authenticate(params[:user], params[:password])

but get the error:

undefined method `authenticate' for Rubyoverflow::User:Class

How can I say that I开发者_Python百科 need the User from Rails model?


Try

 ::User.authenticate(params[:user], params[:password])
0

精彩评论

暂无评论...
验证码 换一张
取 消