Class: ContactsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/contacts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/contacts_controller.rb', line 6

def create
  @contact = Contact.new(contact_params)

  if @contact.save
    redirect_to new_contact_path, flash: { success: I18n.t('created') }
  else
    render 'new'
  end
end

#newObject



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

def new
  @contact = Contact.new
end