Class: Hyrax::Admin::WorkflowRolesController

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

Instance Method Summary collapse

Instance Method Details

#createObject


21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/hyrax/admin/workflow_roles_controller.rb', line 21

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


14
15
16
17
18
19
# File 'app/controllers/hyrax/admin/workflow_roles_controller.rb', line 14

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

#indexObject


7
8
9
10
11
12
# File 'app/controllers/hyrax/admin/workflow_roles_controller.rb', line 7

def index
  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb t(:'hyrax.admin.workflow_roles.header'), hyrax.admin_workflow_roles_path
  @presenter = WorkflowRolesPresenter.new
end