Class: WorksWizardPolicyController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- WorksWizardPolicyController
- Defined in:
- app/controllers/works_wizard_policy_controller.rb
Overview
Controller to handle the policy agreement acknowlegdement before the wizard is started
The wizard flow is shown in the [mermaid diagram here](github.com/pulibrary/pdc_describe/blob/main/docs/wizard_flow.md).
Instance Method Summary collapse
-
#show ⇒ Object
get /works/policy.
-
#update ⇒ Object
post /works/policy.
Methods inherited from ApplicationController
Instance Method Details
#show ⇒ Object
get /works/policy
12 |
# File 'app/controllers/works_wizard_policy_controller.rb', line 12 def show; end |
#update ⇒ Object
post /works/policy
15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/works_wizard_policy_controller.rb', line 15 def update group = Group.find_by(code: params[:group_code]) || current_user.default_group if params[:agreement] == "1" work = Work.create!(created_by_user_id: current_user.id, group:) work.add_provenance_note(DateTime.now, "User agreed to the Data Acceptance and Retention policy", current_user.id) redirect_to work_create_new_submission_path(work) else redirect_to root_path, notice: "You must agree to the policy to deposit" end end |