Sha256: 500feb5a09f7665af35f179a01609eb27b1bd2f27d6463d89cccdf9342a87a07

Contents?: true

Size: 638 Bytes

Versions: 76

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

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

76 entries across 76 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.5 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.4 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.3 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.1 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.3.0 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.2.0 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.1.2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.1.1 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.1.0 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.0.3 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.0.2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.0.1 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-4.0.0 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.6.0.beta10 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.6.0.beta9 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.6.0.beta8 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.5.0.4 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.6.0.beta7 app/controllers/spotlight/contact_email_controller.rb