开发者

devise and invitable plugin : how do you set the invitation_limit

开发者 https://www.devze.com 2023-02-20 11:18 出处:网络
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.

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 yo开发者_运维知识库u setup this up????


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:

gem 'devise', '~>1.2.0'
gem 'devise_invitable', '~>0.4.rc5'

See here for a more in depth write-up about this issue with devise_invitable.

0

精彩评论

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