Ramy
Ramy

Reputation: 21261

Devise Invitable invitation to accept an event?

I'm trying to wrap my head around Devise_Invitable controller. It looks like it uses a good deal of reflection but it seems that it assumes that any sublcass you create will be a User (of some kind - perhaps an admin, etc).

What I would like to do is leverage the gem to invite users to accept (presumably by overriding the update method) or reject an event (presumably by creating a new "reject" method that works a lot like update).

Is this a reasonable thing to try to do or am I totallybarking up the wrong tree? I feel like I have enough knowledge to get myself into deep trouble but not get myself out at this point in my rails learning.

Upvotes: 0

Views: 427

Answers (1)

gregates
gregates

Reputation: 6714

I think devise_invitable is not designed for your use case; it's intended use is for invitation-only user registration. That is, you only want people to be able to sign up for an account on your site if they've been invited to do so and have a special invitation code. That's an authentication problem (which is why there's a devise addon that's a solution for it) -- you need to use tokens in order to authenticate invited users who have not yet registered a password.

Your problem appears very different, at least superficially -- it sounds like you just want to implement a user interface for already-authenticated users.

Upvotes: 1

Related Questions