Class: Hyrax::Dashboard::CollectionMembersController
- Inherits:
-
My::CollectionsController
- Object
- ApplicationController
- MyController
- My::CollectionsController
- Hyrax::Dashboard::CollectionMembersController
- Includes:
- Collections::AcceptsBatches
- Defined in:
- app/controllers/hyrax/dashboard/collection_members_controller.rb
Overview
Shows a list of all collections to the admins
Instance Method Summary collapse
Methods included from Collections::AcceptsBatches
#batch, #batch=, #check_for_empty_batch?
Methods inherited from My::CollectionsController
configure_facets, #index, #search_builder_class
Methods inherited from MyController
Instance Method Details
#after_update ⇒ Object
9 10 11 12 13 14 |
# File 'app/controllers/hyrax/dashboard/collection_members_controller.rb', line 9 def after_update respond_to do |format| format.html { redirect_to success_return_path, notice: t('hyrax.dashboard.my.action.collection_update_success') } format.json { render json: @collection, status: :updated, location: dashboard_collection_path(@collection) } end end |
#after_update_error(err_msg) ⇒ Object
16 17 18 19 20 21 |
# File 'app/controllers/hyrax/dashboard/collection_members_controller.rb', line 16 def after_update_error(err_msg) respond_to do |format| format.html { redirect_to err_return_path, alert: err_msg } format.json { render json: @collection.errors, status: :unprocessable_entity } end end |
#update_members ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/hyrax/dashboard/collection_members_controller.rb', line 23 def update_members err_msg = validate after_update_error(err_msg) if err_msg.present? return if err_msg.present? collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX members = collection.add_member_objects batch_ids = members.collect { |member| member.errors. }.flatten if .size == members.size after_update_error(.uniq.join(', ')) elsif .present? flash[:error] = .uniq.join(', ') after_update else after_update end end |