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]
|
||||
if @completion.update(completion_params)
|
||||
extend_completions!(@completion.contestant)
|
||||
redirect_to @contest
|
||||
if @contestant
|
||||
redirect_to edit_contest_contestant_path(@contest, @contestant)
|
||||
else
|
||||
redirect_to @contest
|
||||
end
|
||||
else
|
||||
if @contestant
|
||||
@action_name = t("helpers.buttons.back_to_contestant")
|
||||
@ -82,8 +86,8 @@ class CompletionsController < ApplicationController
|
||||
def set_contestant
|
||||
if params.key?(:contestant_id)
|
||||
@contestant = Contestant.find(params[:contestant_id])
|
||||
else
|
||||
@contetant = nil
|
||||
elsif params[:completion].key?(:contestant_id)
|
||||
@contestant = Contestant.find(params[:completion][:contestant_id])
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user