Class: AddressesController

Inherits:
ArtfullyOseController show all
Defined in:
app/controllers/addresses_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
12
# File 'app/controllers/addresses_controller.rb', line 4

def create
  address = @person.build_address(params[:address])
  if address.save
    flash[:notice] = "Successfully added an address for #{@person}."
  else
    flash[:error] = "There was a problem creating this address."
  end
  redirect_to person_path(@person)
end

#destroyObject



23
24
# File 'app/controllers/addresses_controller.rb', line 23

def destroy
end

#updateObject



14
15
16
17
18
19
20
21
# File 'app/controllers/addresses_controller.rb', line 14

def update
  if @person.update_address(params[:address], current_user.current_organization.time_zone, current_user)
    flash[:notice] = "Successfully updated the address for #{@person}."
  else
    flash[:error] = "There was a problem updating this address."
  end
  redirect_to person_path(@person)
end