Class: Spree::Api::V2::Storefront::HomepageSectionsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Storefront::HomepageSectionsController
- Defined in:
- app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb
Instance Method Summary collapse
- #collection ⇒ Object
- #collection_serializer ⇒ Object
- #model_class ⇒ Object
- #resource_serializer ⇒ Object
Instance Method Details
#collection ⇒ Object
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_serializer ⇒ Object
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_class ⇒ Object
6 7 8 |
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 6 def model_class SpreeCmCommissioner::HomepageSection end |
#resource_serializer ⇒ Object
14 15 16 |
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 14 def resource_serializer Spree::V2::Storefront::HomepageSectionSerializer end |