Sha256: 7cf86ad8e5ac1c89a001ec5583290a26be9565b1fe8b701b09cf318cd376291b
Contents?: true
Size: 760 Bytes
Versions: 17
Compression:
Stored size: 760 Bytes
Contents
module PandaCms class FormSubmissionsController < ApplicationController def create vars = params.except(:authenticity_token, :controller, :action, :id) form = PandaCms::Form.find(params[:id]) form_submission = PandaCms::FormSubmission.create(form_id: params[:id], data: vars.to_unsafe_h) form.update(submission_count: form.submission_count + 1) PandaCms::FormMailer.notification_email(form: form, form_submission: form_submission).deliver_now if (completion_path = form&.completion_path) redirect_to completion_path else # TODO: This isn't a great fallback, we should do something nice here... # Perhaps a simple JS alert when sent? redirect_to "/" end end end end
Version data entries
17 entries across 17 versions & 1 rubygems