开发者

Model namespace

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜