Class: Spree::Api::V2::Platform::PlacesController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Platform::PlacesController
- Defined in:
- app/controllers/spree/api/v2/platform/places_controller.rb
Instance Method Summary collapse
- #collection ⇒ Object
- #collection_serializer ⇒ Object
- #index ⇒ Object
- #model_class ⇒ Object
- #resource_serializer ⇒ Object
Instance Method Details
#collection ⇒ Object
16 17 18 |
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 16 def collection @collection ||= fetch_places end |
#collection_serializer ⇒ Object
28 29 30 |
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 28 def collection_serializer SpreeCmCommissioner::Api::V2::Platform::PlaceSerializer end |
#index ⇒ Object
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_class ⇒ Object
20 21 22 |
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 20 def model_class SpreeCmCommissioner::Place end |
#resource_serializer ⇒ Object
24 25 26 |
# File 'app/controllers/spree/api/v2/platform/places_controller.rb', line 24 def resource_serializer SpreeCmCommissioner::Api::V2::Platform::PlaceSerializer end |