Sha256: 62422b149ba3716dc4371745604bdb6630fa013af1999eecab7cd96e304a7f26

Contents?: true

Size: 607 Bytes

Versions: 24

Compression:

Stored size: 607 Bytes

Contents

module Spotlight
  ##
  # CRUD actions for exhibit contact emails
  class ContactEmailController < Spotlight::ApplicationController
    rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

    before_action :authenticate_user!
    load_and_authorize_resource :exhibit, class: 'Spotlight::Exhibit'
    load_and_authorize_resource through: :exhibit

    def destroy
      @contact_email.destroy
      render json: { success: true, error: nil }
    end

    private

    def record_not_found(_error)
      render json: { success: false, error: 'Not Found' }, status: :not_found
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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