Class: FrontEnd::EnquiriesController

Inherits:
MainApplicationController
  • Object
show all
Defined in:
app/controllers/c/front_end/enquiries_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/c/front_end/enquiries_controller.rb', line 11

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

#newObject



6
7
8
9
# File 'app/controllers/c/front_end/enquiries_controller.rb', line 6

def new
  get_page C::Page, 'contact-us'
  @enquiry = C::Enquiry.new
end

#thanksObject



22
23
24
# File 'app/controllers/c/front_end/enquiries_controller.rb', line 22

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