CanCan 错误“未定义的方法角色?”与设计
嘿,我希望你能帮助我:
我正在阅读本教程
我不太确定将角色放在哪里?教程中的方法,因为它没有说明将其放置在哪里。
现在,当我想要注册或登录时,它给了我这个错误
非常感谢
Hey I hope you can help me:
I was going through this tutorial
http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/ and I did every step by step.
I wasnt quite sure where to put the role?-method from the tutorial, because it doesnt say where to place it.
Now it gives me this error when I want to sign_up or Sign_in
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将其添加到用户模型中(
app/models/user.rb
)You need to add it in the user model (
app/models/user.rb
)您应该参考此:
https://github.com/ryanb/cancan/wiki /基于角色的授权
我认为这真的很有帮助..
You should refer to this:
https://github.com/ryanb/cancan/wiki/Role-Based-Authorization
I think it'll be really helpful..