Sha256: 4f524968e3fec2da208c13b9320af3fe95b94b293daee8450701ac6395bd3953

Contents?: true

Size: 552 Bytes

Versions: 3

Compression:

Stored size: 552 Bytes

Contents

module Spree
  module Api
    class AddressesController < Spree::Api::BaseController
      respond_to :json

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

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_api-1.3.5 app/controllers/spree/api/addresses_controller.rb
spree_api-1.3.4 app/controllers/spree/api/addresses_controller.rb
spree_api-1.3.3 app/controllers/spree/api/addresses_controller.rb