Class: Spree::Api::V2::Storefront::HomepageBackgroundController

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

Instance Method Summary collapse

Instance Method Details

#model_classObject



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

def model_class
  SpreeCmCommissioner::HomepageBackground
end

#resourceObject



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

def resource
  @resource ||= model_class.active.where(segment: params[:homepage_id] || :general).order(priority: :asc).first
end

#resource_serializerObject



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

def resource_serializer
  SpreeCmCommissioner::V2::Storefront::HomepageBackgroundSerializer
end