Class: Sufia::Admin::AdminSetsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Sufia::Admin::AdminSetsController
- Includes:
- CurationConcerns::CollectionsControllerBehavior
- Defined in:
- app/controllers/sufia/admin/admin_sets_controller.rb
Class Method Summary collapse
-
.local_prefixes ⇒ Object
Override the default prefixes so that we use the collection partals.
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
-
#repository ⇒ Object
for the AdminSetService.
- #show ⇒ Object
- #update ⇒ Object
Class Method Details
.local_prefixes ⇒ Object
Override the default prefixes so that we use the collection partals.
80 81 82 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 80 def self.local_prefixes ["sufia/admin/admin_sets", "collections", 'catalog'] end |
Instance Method Details
#create ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 54 def create if create_admin_set = .attributes = .save! # to create permission template on create redirect_to sufia.admin_admin_sets_path else setup_form render :new end end |
#destroy ⇒ Object
66 67 68 69 70 71 72 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 66 def destroy if @admin_set.destroy redirect_to sufia.admin_admin_sets_path, notice: t(:'sufia.admin.admin_sets.delete.notification') else redirect_to sufia.admin_admin_set_path(@admin_set), alert: @admin_set.errors..to_sentence end end |
#edit ⇒ Object
40 41 42 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 40 def edit setup_form end |
#index ⇒ Object
29 30 31 32 33 34 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 29 def index t(:'sufia.controls.home'), root_path t(:'sufia.toolbar.admin.menu'), sufia.admin_path t(:'sufia.admin.sidebar.admin_sets'), sufia.admin_admin_sets_path @admin_sets = CurationConcerns::AdminSetService.new(self).search_results(:read) end |
#new ⇒ Object
36 37 38 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 36 def new setup_form end |
#repository ⇒ Object
for the AdminSetService
75 76 77 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 75 def repository repository_class.new(blacklight_config) end |
#show ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 21 def show t(:'sufia.controls.home'), root_path t(:'sufia.toolbar.admin.menu'), sufia.admin_path t(:'sufia.admin.sidebar.admin_sets'), sufia.admin_admin_sets_path 'View Set', request.path super end |
#update ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/sufia/admin/admin_sets_controller.rb', line 44 def update if @admin_set.update(admin_set_params) .update() redirect_to sufia.admin_admin_sets_path else setup_form render :edit end end |