Sha256: bfff0e1ffb556848e6635d06b004c8eb5ffb70271ea9da08068bfce2bf0a56ff

Contents?: true

Size: 880 Bytes

Versions: 35

Compression:

Stored size: 880 Bytes

Contents

module Cmor
  module Contact
    module Backend
      class ContactRequestsController < Cmor::Core::Backend::ResourcesController::Base
        def self.resource_class
          Cmor::Contact::ContactRequest
        end

        def self.available_rest_actions
          super - %i(new create edit update)
        end

        private

        def permitted_params
          params.require(:contact_request).permit(:name, :email, :phone, :ip_address, :message, :nickname, :accept_terms_of_service)
        end

        def collection_scope
          super.order(created_at: :desc)
        end

        module Notification
          def notify
            @resource = load_resource
            @resource.notify
            redirect_back fallback_location: { action: :index }, notice: t('.success')
          end
        end

        include Notification
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
cmor_contact_backend-0.0.60.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.59.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.58.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.57.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.56.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.55.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.54.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.53.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.52.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.51.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.50.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.49.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.48.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.45.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.44.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.43.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.42.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.41.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.40.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb
cmor_contact_backend-0.0.39.pre app/controllers/cmor/contact/backend/contact_requests_controller.rb