Class: InvitationCodesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/invitation_codes_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject


10
11
12
13
14
15
16
17
18
# File 'app/controllers/invitation_codes_controller.rb', line 10

def show
  if user_signed_in?
    invite = InvitationCode.find_by_token!(params[:id])
    flash[:notice] = I18n.t("invitation_codes.already_logged_in", inviter: invite.user.name)
    redirect_to person_path(invite.user.person)
  else
    redirect_to new_user_registration_path(invite: {token: params[:id]})
  end
end