Sha256: 245a6014b6b35dbf81f6c0eb0dc060817a3991798ec959efc93fe218a1935dbd
Contents?: true
Size: 991 Bytes
Versions: 84
Compression:
Stored size: 991 Bytes
Contents
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
84 entries across 84 versions & 1 rubygems