Class: Spree::Api::AddressesController
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys, #set_jsonp_format
included
Instance Method Details
#show ⇒ Object
5
6
7
8
9
|
# File 'app/controllers/spree/api/addresses_controller.rb', line 5
def show
@address = Address.find(params[:id])
authorize! :read, @address
respond_with(@address)
end
|
#update ⇒ Object
11
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/spree/api/addresses_controller.rb', line 11
def update
@address = Address.find(params[:id])
authorize! :read, @address
if @address.update_attributes(params[:address])
respond_with(@address, :default_template => :show)
else
invalid_resource!(@address)
end
end
|