Devise invitable upgrade after_invite_path_for has different resource

189 Views Asked by At

I recently upgraded to devise_invitable 1.5.1.

Previously I was overwriting the after_invite_path_for method in my

class InvitationsController < Devise::InvitationsController controller

I wanted to send the inviter to a path created based on the invitee so I was using

permissions_path(resource)

but now, with the new version, the resource actually represents the inviter, whereas before it was the invitee.

How do I get the invitee in this method so I can retrieve the right path?

1

There are 1 best solutions below

0
ryan2johnson9 On BEST ANSWER

user details are available in params[:user]

permissions_path(User.find_by_email! params[:user][:email])