Class: Spree::Api::V1::AddressesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/api/v1/addresses_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#current_api_user

Instance Method Summary collapse

Methods inherited from BaseController

#map_nested_attributes_keys

Methods included from ControllerSetup

included

Instance Method Details

#showObject



5
6
7
8
# File 'app/controllers/spree/api/v1/addresses_controller.rb', line 5

def show
  @address = Address.find(params[:id])
  authorize! :read, @address
end

#updateObject



10
11
12
13
14
15
# File 'app/controllers/spree/api/v1/addresses_controller.rb', line 10

def update
  @address = Address.find(params[:id])
  authorize! :read, @address
  @address.update_attributes(params[:address])
  render :show, :status => 200
end