Sha256: 2eff4b5f1a42fa4a86d14dacbdba28a8522f1a14bea119116f6faeee2b4c78f2
Contents?: true
Size: 1022 Bytes
Versions: 30
Compression:
Stored size: 1022 Bytes
Contents
# frozen_string_literal: true module Spotlight ## # CRUD actions for document tags class TagsController < Spotlight::ApplicationController before_action :authenticate_user! load_and_authorize_resource :exhibit, class: Spotlight::Exhibit def index authorize! :tag, @exhibit @tags = @exhibit.owned_tags add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit) add_breadcrumb t(:'spotlight.curation.sidebar.tags'), exhibit_tags_path(@exhibit) respond_to do |format| format.html format.json { render json: @exhibit.owned_tags.map(&:name) } end end def destroy authorize! :tag, @exhibit # warning: this causes every solr document with this tag to reindex. That could be slow. @exhibit.owned_taggings.where(tag_id: params[:id]).destroy_all redirect_to exhibit_tags_path(@exhibit) end end end
Version data entries
30 entries across 30 versions & 1 rubygems