Sha256: 5fea30f52bfd88b62032098375226c87fee11b6d8be5c2aff87cc2234bb8c4d9

Contents?: true

Size: 625 Bytes

Versions: 65

Compression:

Stored size: 625 Bytes

Contents

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

65 entries across 65 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.4.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.3.3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.3.2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.3.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.3.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.2.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.2.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.1.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc6 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc5 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-2.0.0.rc1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-1.5.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-1.4.1 app/controllers/spotlight/attachments_controller.rb