fixed no submitter for submission issue

pull/150/merge^2
iozeey 2 years ago
parent e50ef7f69b
commit f246dea680

@ -9,7 +9,7 @@ class StartFormController < ApplicationController
before_action :load_template before_action :load_template
def show def show
@submitter = @template.submissions.new.submitters.new(uuid: @template.submitters.second['uuid']) @submitter = @template.submitters.second.nil? ? @template.submissions.new.submitters.new(uuid: @template.submitters.first['uuid']) : @template.submissions.new.submitters.new(uuid: @template.submitters.second['uuid'])
end end
def update def update
@ -21,7 +21,7 @@ class StartFormController < ApplicationController
redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email]) redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email])
else else
@submitter.assign_attributes( @submitter.assign_attributes(
uuid: @template.submitters.second['uuid'], uuid: @template.submitters.second.nil? ? @template.submitters.first['uuid'] : @template.submitters.second['uuid'],
ip: request.remote_ip, ip: request.remote_ip,
ua: request.user_agent ua: request.user_agent
) )

Loading…
Cancel
Save