Add url helpers & specs for offline participation forms
All checks were successful
CI / scan_ruby (push) Successful in 19s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 14s
CI / test (push) Successful in 38s

#5
This commit is contained in:
sto
2025-12-10 15:12:19 +01:00
parent 8cea403dc9
commit 2c87a5b63c
4 changed files with 171 additions and 2 deletions

View File

@@ -192,7 +192,7 @@ class ContestsController < ApplicationController
@offline.contest = @contest
@offline.start_time = Time.now()
if @offline.save
redirect_to "/public/#{@contest.friendly_id}/offline/#{@offline.generate_token_for(:token)}"
redirect_to offline_form_edit_path(@contest, @offline)
else
render :offline_new, status: :unprocessable_entity
end
@@ -242,7 +242,7 @@ class ContestsController < ApplicationController
remaining_pieces: @offline.remaining_pieces)
extend_completions!(contestant)
end
redirect_to "/public/#{@contest.friendly_id}/offline/#{@offline.generate_token_for(:token)}/completed"
redirect_to offline_form_completed_path(@contest, @offline)
else
render :offline_edit, status: :unprocessable_entity
end