Class: Spotlight::TagsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Spotlight::TagsController
- Defined in:
- app/controllers/spotlight/tags_controller.rb
Overview
CRUD actions for document tags
Instance Method Summary collapse
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 = @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: .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_or_to(fallback_url, notice: t(:'helpers.submit.tags.batch_updated', count: .count)) end |