Class: SimpleAddress::AddressesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/simple_address/addresses_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
# File 'app/controllers/simple_address/addresses_controller.rb', line 12

def create
  @address = Address.create(address_params)
  respond_to do |format|
    format.html { redirect_to @address }
    format.json { render json: { address_id: @address.id } }
  end
end

#editObject



20
21
# File 'app/controllers/simple_address/addresses_controller.rb', line 20

def edit
end

#newObject



8
9
10
# File 'app/controllers/simple_address/addresses_controller.rb', line 8

def new
  @address = Address.new
end

#showObject



5
6
# File 'app/controllers/simple_address/addresses_controller.rb', line 5

def show
end

#updateObject



23
24
25
26
27
28
29
# File 'app/controllers/simple_address/addresses_controller.rb', line 23

def update
  @address.update(address_params)
  respond_to do |format|
    format.html { redirect_to @address }
    format.json { render json: { address_id: @address.id } }
  end
end