Sha256: ce044a3a9c1dd05d86c1aeac1aaf3738f7f720960bf7c7a75c6a8226227af6bc

Contents?: true

Size: 656 Bytes

Versions: 38

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  ##
  # Create image attachments for the sir-trevor image widget
  class AttachmentsController < ApplicationController
    before_action :authenticate_user!
    load_and_authorize_resource :exhibit, class: 'Spotlight::Exhibit'
    load_and_authorize_resource through: :exhibit

    # POST /attachments
    def create
      @attachment.attributes = attachment_params
      @attachment.save!
      render json: @attachment
    end

    private

    # Only allow a trusted parameter "white list" through.
    def attachment_params
      params.require(:attachment).permit(:name, :file, :uid)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
blacklight-spotlight-3.2.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.1.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc6 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc5 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.rc1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.10 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.9 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.8 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.7 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.6 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.5 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.0.0.alpha.3 app/controllers/spotlight/attachments_controller.rb