Class: Spotlight::TagsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Spotlight::TagsController
- Defined in:
- app/controllers/spotlight/tags_controller.rb
Overview
CRUD actions for document tags
Instance Method Summary collapse
Methods included from Concerns::ApplicationController
#enabled_in_spotlight_view_type_configuration?, #field_enabled?
Methods included from Controller
#blacklight_config, #current_exhibit, #current_masthead, #current_masthead=, #current_site, #default_url_options, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_path, #resource_masthead?, #search_action_url, #search_facet_path, #search_state, #set_exhibit_locale_scope, #set_locale
Methods included from Config
#exhibit_specific_blacklight_config
Instance Method Details
#destroy ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/spotlight/tags_controller.rb', line 27 def destroy Spotlight::RenameTagsJob.perform_later(@exhibit, @tag, to: nil) redirect_to (@exhibit) end |
#index ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/spotlight/tags_controller.rb', line 15 def index @tags = @exhibit. t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit) t(:'spotlight.curation.sidebar.tags'), (@exhibit) respond_to do |format| format.html format.json { render json: @tags.map(&:name) } end end |
#rename ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/spotlight/tags_controller.rb', line 33 def rename Spotlight::RenameTagsJob.perform_later(@exhibit, @tag, to: params[:new_tag]) redirect_to (@exhibit) end |
#update_all ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/spotlight/tags_controller.rb', line 39 def update_all = batch_update_params['owned_tags_attributes'].values.select do |tag| tag[:name].present? && tag[:current_name]&.strip != tag[:name]&.strip end () redirect_back fallback_location: fallback_url, notice: t(:'helpers.submit.tags.batch_updated', count: .count) end |