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



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

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



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

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

#indexObject



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

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