Class: Spree::ContactUs::ContactsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/contact_us/contacts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/spree/contact_us/contacts_controller.rb', line 3

def create
  @contact = Spree::ContactUs::Contact.new(params[:contact_us_contact])

  if @contact.save
    redirect_to('/', :notice => t('spree.contact_us.notices.success'))
  else
    render :new
  end
end

#newObject



13
14
15
# File 'app/controllers/spree/contact_us/contacts_controller.rb', line 13

def new
  @contact = Spree::ContactUs::Contact.new
end