Class: CurationConcerns::Admin::WorkflowRolesController

Inherits:
CurationConcerns::ApplicationController show all
Includes:
CurationConcerns::AdminPage
Defined in:
app/controllers/curation_concerns/admin/workflow_roles_controller.rb

Instance Method Summary collapse

Methods included from CurationConcerns::ApplicationControllerBehavior

#deny_access, #render_404, #render_json_response

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/curation_concerns/admin/workflow_roles_controller.rb', line 18

def create
  authorize! :create, Sipity::WorkflowResponsibility
  form = Forms::WorkflowResponsibilityForm.new(params[:sipity_workflow_responsibility])
  begin
    form.save!
  rescue ActiveRecord::RecordNotUnique
    logger.info "Not unique *****\n\n\n"
  end
  redirect_to admin_workflow_roles_path
end

#destroyObject



11
12
13
14
15
16
# File 'app/controllers/curation_concerns/admin/workflow_roles_controller.rb', line 11

def destroy
  responsibility = Sipity::WorkflowResponsibility.find(params[:id])
  authorize! :destroy, responsibility
  responsibility.destroy
  redirect_to admin_workflow_roles_path
end

#indexObject



7
8
9
# File 'app/controllers/curation_concerns/admin/workflow_roles_controller.rb', line 7

def index
  @presenter = WorkflowRolePresenter.new
end