Class: ContactsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @contact = Contact.new(params[:contact] || {})
  respond_to do |format|
    if @contact.valid? &&  @contact.save
      ContactMailer.message_email(@contact).deliver
      format.html { redirect_to(contact_path, :notice => t("message_sent")) }
    else
      format.html { render :action => "new" }
    end
  end
end

#editObject



7
8
9
# File 'app/controllers/contacts_controller.rb', line 7

def edit
  redirect_to new_contact_path
end

#newObject



3
4
5
# File 'app/controllers/contacts_controller.rb', line 3

def new
  @contact = Contact.new
end