Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= link_to "Cancel Invitation", remove_user_invitation_path(invitation_token: invited.invitation_token), confirm: "Are you sure?", class: 'btn btn-mini btn-danger' %>
- 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
- class InvitationsController < ApplicationController
- ...
- before_filter :user_from_invitation_token
- def remove
- User.destroy(@user.id)
- flash[:notice] = 'Invitation removed'
- redirect_to company_users_path
- end
- private
- def user_from_invitation_token
- unless params[:invitation_token] && @user = @company.invited_users.where(invitation_token: params[:invitation_token]).first
- flash[:error] = 'Invitation not found'
- redirect_to company_users_path
- end
- end
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement