Skip to content

Commit

Permalink
inline another render
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchud committed Nov 19, 2024
1 parent 4064d4f commit 0df811a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions app/controllers/evaluators_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ def create
evaluator_invitation_params
)

handle_invitation_result(result)
if result[:success]
redirect_to phase_evaluators_path(@phase), notice: result[:message]
else
flash.now[:alert] = result[:message]
@evaluator_invitations = @phase.evaluator_invitations
@existing_evaluators = @phase.evaluators
render :index
end
end

def destroy
Expand Down Expand Up @@ -59,15 +66,4 @@ def evaluator_invitation_params
:first_name, :last_name, :email, :challenge_id, :phase_id, :last_invite_sent
)
end

def handle_invitation_result(result)
if result[:success]
redirect_to phase_evaluators_path(@phase), notice: result[:message]
else
flash.now[:alert] = result[:message]
@evaluator_invitations = @phase.evaluator_invitations
@existing_evaluators = @phase.evaluators
render :index
end
end
end

0 comments on commit 0df811a

Please sign in to comment.