Sha256: c8af0dbdeaa03c3c584fae035107d2860ea29bc0cc122a8a4d083b4e592665b6

Contents?: true

Size: 407 Bytes

Versions: 6

Compression:

Stored size: 407 Bytes

Contents

class ContactUs::ContactsController < ApplicationController
  
  def new
    @contact = ContactUs::Contact.new(:id=>1)
  end

  def create
    @contact = ContactUs::Contact.new(params[:contact_us_contact])
    
    if @contact.save    
      redirect_to('/', :notice => "Contact email was successfully sent.")
    else
      flash[:error] = "You must enter both fields."
      render :new
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
contact_us-0.0.6 app/controllers/contact_us/contacts_controller.rb
contact_us-0.0.5 app/controllers/contact_us/contacts_controller.rb
contact_us-0.0.4 app/controllers/contact_us/contacts_controller.rb
contact_us-0.0.3 app/controllers/contact_us/contacts_controller.rb
contact_us-0.0.2 app/controllers/contact_us/contacts_controller.rb
contact_us-0.0.1 app/controllers/contact_us/contacts_controller.rb