设计和邀请插件:如何设置invitation_limit
您好,我的设计和可邀请插件可以正常工作,但我想对用户可以邀请的人数设置默认限制。
根据github上的文档,它提到你可以通过invitation_limit设置这个数字
,但是我尝试在设计配置文件中使用它,但它抱怨未定义的方法。
我检查了来源,肯定有一个invitation_limit 属性正在减少。我尝试将其添加为我的用户模型的属性,但它仍然抱怨。
这个要怎么设置啊???
Hi ive got devise and the invitable plugin working but Id like to set a default limit on how many people a user can invite.
According to the documentaion on github it mentions that you can set this number via invitation_limit
however ive tried using this in devises config file but it complains of undefined method.
I checked the source and theres definately an invitation_limit attribute being decremented. I tried adding this as an attribute to my users model but it still complains.
How do you setup this up????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是您使用的 devise_invitable gem 版本不包含“invitation_limit”。您至少需要使用 v0.4.rc5 才能获得文档中提到的所有新功能。这肯定有点令人困惑。您的 Gemfile 应如下所示:
请参阅此处,了解有关此问题的更深入的文章 devise_invitable。
My guess is that you are using the version of the devise_invitable gem that does not include "invitation_limit." You will need to use at least v0.4.rc5 to get all the new coolness that the documentation talks about. It's definitely a little confusing. Your Gemfile should look like this:
See here for a more in depth write-up about this issue with devise_invitable.