Class: Spree::Api::V1::AddressesController
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#content_type, #permitted_line_item_attributes
included
Instance Method Details
#show ⇒ Object
7
8
9
10
11
|
# File 'app/controllers/spree/api/v1/addresses_controller.rb', line 7
def show
authorize! :show, @order, order_token
@address = find_address
respond_with(@address)
end
|
#update ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/spree/api/v1/addresses_controller.rb', line 13
def update
authorize! :update, @order, order_token
@address = find_address
if @address.update(address_params)
respond_with(@address, default_template: :show)
else
invalid_resource!(@address)
end
end
|