Class: AddressesController
- Inherits:
-
ArtfullyOseController
- Object
- ActionController::Base
- ArtfullyOseController
- AddressesController
- Defined in:
- app/controllers/addresses_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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(@person) end |
#destroy ⇒ Object
23 24 |
# File 'app/controllers/addresses_controller.rb', line 23 def destroy end |
#update ⇒ Object
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(@person) end |