Sha256: 91ae9879b3770fc377f586d0f9aace860384193dce00499d7aee1c4d5d9f4b82

Contents?: true

Size: 698 Bytes

Versions: 8

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true
require_dependency 'c/application_controller'

module C
  class FrontEnd::EnquiriesController < MainApplicationController
    def new
      get_page C::Page, 'contact-us'
      @enquiry = C::Enquiry.new
    end

    def create
      get_page C::Page, 'contact-us'
      @enquiry = C::Enquiry.new(enquiry_params)
      if @enquiry.save
        C::EnquiriesMailer.new_enquiry(@enquiry).deliver_now
        redirect_to thanks_front_end_enquiries_path
      else
        render :new
      end
    end

    def thanks
      @enquiry = C::Enquiry.new
    end

    private

    def enquiry_params
      params.require(:enquiry).permit(:name, :email, :body)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cd2_catton_cms-1.1.35 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.34 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.33 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.32 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.31 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.30 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.20 app/controllers/c/front_end/enquiries_controller.rb
cd2_catton_cms-1.1.10 app/controllers/c/front_end/enquiries_controller.rb