|
|
|
@ -1,9 +1,7 @@
|
|
|
|
# frozen_string_literal: true
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
|
|
class SubmissionsController < ApplicationController
|
|
|
|
class SubmissionsController < ApplicationController
|
|
|
|
before_action :load_template, only: %i[new create]
|
|
|
|
load_and_authorize_resource :template, only: %i[new create]
|
|
|
|
authorize_resource :template, only: %i[new create]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
load_and_authorize_resource :submission, only: %i[show destroy]
|
|
|
|
load_and_authorize_resource :submission, only: %i[show destroy]
|
|
|
|
|
|
|
|
|
|
|
|
prepend_before_action :maybe_redirect_com, only: %i[show]
|
|
|
|
prepend_before_action :maybe_redirect_com, only: %i[show]
|
|
|
|
@ -113,8 +111,4 @@ class SubmissionsController < ApplicationController
|
|
|
|
def submissions_params
|
|
|
|
def submissions_params
|
|
|
|
params.permit(submission: { submitters: [:uuid, :email, :phone, :name, { values: {} }] })
|
|
|
|
params.permit(submission: { submitters: [:uuid, :email, :phone, :name, { values: {} }] })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def load_template
|
|
|
|
|
|
|
|
@template = Template.accessible_by(current_ability).find(params[:template_id])
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|