Class: ContactsController
- Inherits:
-
Spree::BaseController
- Object
- Spree::BaseController
- ContactsController
- Defined in:
- app/controllers/contacts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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.(@contact).deliver format.html { redirect_to(contact_path, :notice => t("mini_contact.message_sent")) } else format.html { render :action => "new" } end end end |
#edit ⇒ Object
7 8 9 |
# File 'app/controllers/contacts_controller.rb', line 7 def edit redirect_to new_contact_path end |
#new ⇒ Object
3 4 5 |
# File 'app/controllers/contacts_controller.rb', line 3 def new @contact = Contact.new end |