Class: ContactForm::FormsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/contact_form/forms_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/contact_form/forms_controller.rb', line 8

def create
  @form = Form.new(params[:form])
  if @form.valid?
	  FormMailer.new_contact(@form).deliver
    FormMailer.auto_reply(@form).deliver
    redirect_to after_create_contact_path, notice: I18n.t(".contact_form.controllers.forms_controller.success")
  else
	 render "new"
  end
end

#newObject



4
5
6
# File 'app/controllers/contact_form/forms_controller.rb', line 4

def new
  @form = Form.new
end