Class: Hyrax::WorkflowActionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/hyrax/workflow_actions_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/hyrax/workflow_actions_controller.rb', line 5

def update
  @curation_concern = ActiveFedora::Base.find(params[:id])
  workflow_action_form = Hyrax::Forms::WorkflowActionForm.new(
    current_ability: current_ability,
    work: @curation_concern,
    attributes: workflow_action_params
  )
  if workflow_action_form.save
    after_update_response
  else
    respond_to do |wants|
      wants.html { render 'hyrax/base/unauthorized', status: :unauthorized }
      wants.json { render_json_response(response_type: :unprocessable_entity, options: { errors: @curation_concern.errors }) }
    end
  end
end