Class: Spree::Api::V2::Platform::PlacesController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/spree/api/v2/platform/places_controller.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



16
17
18
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 16

def collection
  @collection ||= fetch_places
end

#collection_serializerObject



28
29
30
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 28

def collection_serializer
  SpreeCmCommissioner::Api::V2::Platform::PlaceSerializer
end

#indexObject



8
9
10
11
12
13
14
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 8

def index
  result = collection_serializer.new(collection).serializable_hash

  respond_with(result) do |format|
    format.json { render json: result }
  end
end

#model_classObject



20
21
22
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 20

def model_class
  SpreeCmCommissioner::Place
end

#resource_serializerObject



24
25
26
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 24

def resource_serializer
  SpreeCmCommissioner::Api::V2::Platform::PlaceSerializer
end