Class: Spree::Api::AddressesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::AddressesController
- Defined in:
- app/controllers/spree/api/addresses_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/spree/api/addresses_controller.rb', line 8 def show :show, @order, order_token find_address respond_with(@address) end |
#update ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/spree/api/addresses_controller.rb', line 14 def update :update, @order, order_token find_address if @order.update({ "#{@order_source}_attributes" => address_params }) @address = @order.send(@order_source) respond_with(@address, default_template: :show) else @address = @order.send(@order_source) invalid_resource!(@address) end end |