Class: Spree::Api::V2::Storefront::HomepageSectionsController

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

Instance Method Summary collapse

Instance Method Details

#collectionObject



18
19
20
21
22
23
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 18

def collection
  @collection ||= model_class.filter_by_segment(params[:homepage_id] || :general)
                             .active
                             .where(tenant_id: nil)
                             .order(position: :asc)
end

#collection_serializerObject



10
11
12
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 10

def collection_serializer
  Spree::V2::Storefront::HomepageSectionSerializer
end

#model_classObject



6
7
8
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 6

def model_class
  SpreeCmCommissioner::HomepageSection
end

#resource_serializerObject



14
15
16
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 14

def resource_serializer
  Spree::V2::Storefront::HomepageSectionSerializer
end