app/controllers/project_invites_controller.rb
# PUT :id/delegate
#
# invites the suggested user
PUT :id/delegate
invites the suggested user
PUT : id / delegate invites the suggested user
def invite_via_suggestion
    @user = User.create_with_organisation_membership_from_project_invite @invite
    if @user.valid?
      RequestMailer.invite_via_suggestion @user, @invite, current_user
      @invite.set_handled_suggested_user!
      redirect_to :dashboard, notice: "#{@user.email} has been sent an invite"
    elsif account_has_been_claimed? @user
      @invite.set_handled_suggested_user!
      redirect_to :dashboard, notice: "This user has already been invited to Digital Social" 
    else
      redirect_to :dashboard, alert: "There was an error inviting #{@user.email}, please try again later." 
    end
  end
def invite_via_suggestion @user = User . create_with_organisation_membership_from_project_invite @invite if @user . valid? RequestMailer . invite_via_suggestion @user , @invite , current_user @invite . set_handled_suggested_user! redirect_to :dashboard , notice : "#{@user.email} has been sent an invite" elsif account_has_been_claimed? @user @invite . set_handled_suggested_user! redirect_to :dashboard , notice : "This user has already been invited to Digital Social" else redirect_to :dashboard , alert : "There was an error inviting #{@user.email}, please try again later." end end
PUT :id/delegate
invites the suggested user
PUT : id / delegate invites the suggested user