Update completion -> back to contestant
This commit is contained in:
parent
79fb1edfaf
commit
67492cdd15
@ -52,7 +52,11 @@ class CompletionsController < ApplicationController
|
|||||||
@completion.contestant_id = params[:contestant_id] if params[:contestant_id]
|
@completion.contestant_id = params[:contestant_id] if params[:contestant_id]
|
||||||
if @completion.update(completion_params)
|
if @completion.update(completion_params)
|
||||||
extend_completions!(@completion.contestant)
|
extend_completions!(@completion.contestant)
|
||||||
redirect_to @contest
|
if @contestant
|
||||||
|
redirect_to edit_contest_contestant_path(@contest, @contestant)
|
||||||
|
else
|
||||||
|
redirect_to @contest
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if @contestant
|
if @contestant
|
||||||
@action_name = t("helpers.buttons.back_to_contestant")
|
@action_name = t("helpers.buttons.back_to_contestant")
|
||||||
@ -82,8 +86,8 @@ class CompletionsController < ApplicationController
|
|||||||
def set_contestant
|
def set_contestant
|
||||||
if params.key?(:contestant_id)
|
if params.key?(:contestant_id)
|
||||||
@contestant = Contestant.find(params[:contestant_id])
|
@contestant = Contestant.find(params[:contestant_id])
|
||||||
else
|
elsif params[:completion].key?(:contestant_id)
|
||||||
@contetant = nil
|
@contestant = Contestant.find(params[:completion][:contestant_id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user