I have devise_invitable installed on my rails application. Creating a new invitation works properly.
I built a view to manage the list of invitations, and created a form button to allow the admin to delete outstanding invitations. Here is the code:
<%= link_to "Cancel Invitation", remove_user_invitation_path(invitation_token: invited.invitation_token), confirm: "Are you sure?", class: 'btn btn-mini btn-danger' %>
The result is always an error "The invitation token provided is not valid!"
Looking at the server logs, I see something like this:
Started GET "/invitation/remove?invitation_token=f4e26062f27c7cc32a60e2024b9dba2b1350abba" for 127.0.0.1 at 2013-10-28 15:07:44 -0700
Processing by Devise::InvitationsController#destroy as HTML
Parameters: {"invitation_token"=>"f4e26062f27c7cc32a60e2024b9dba2b1350abba"}
User Load (2.9ms) SELECT "users".* FROM "users" WHERE "users"."invitation_token" = '46488d68fb36387ec639d5d6b9749273b56561a944f76eeefb2f5294ea5225e6' LIMIT 1
This suggests that the delete method is not expecting the raw invite token. (I can understand this from a security stand point.)
What value should I be passing to remove_user_invitation_path?