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-3.0.3 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.1 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc6 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc5 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc4 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc3 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.rc1 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.10 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.9 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.8 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.7 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.6 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.5 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.4 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.3 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.2 app/controllers/spotlight/contact_email_controller.rb
blacklight-spotlight-3.0.0.alpha.1 app/controllers/spotlight/contact_email_controller.rb