Sha256: a64bb6f0acc08ced6261a8804039e2fba32d8003ec8770a098e14fbe2255072b

Contents?: true

Size: 642 Bytes

Versions: 43

Compression:

Stored size: 642 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 trusted parameters through.
    def attachment_params
      params.require(:attachment).permit(:name, :file, :uid)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
blacklight-spotlight-3.6.0.beta10 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta9 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta8 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.5.0.4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta7 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.5.0.3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta6 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta5 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.6.0.beta1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.5.0.2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.5.0.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.5.0 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.4.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.4 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.3 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.2.2 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.2.1 app/controllers/spotlight/attachments_controller.rb
blacklight-spotlight-3.4.2 app/controllers/spotlight/attachments_controller.rb