Class: Spree::Api::V2::ResourceController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Spree::Api::V2::ResourceController
- Includes:
- Caching, CollectionOptionsHelpers
- Defined in:
- app/controllers/spree/api/v2/resource_controller.rb
Direct Known Subclasses
Platform::DigitalsController, Platform::MenusController, Platform::OrdersController, Platform::PaymentsController, Platform::ProductsController, Platform::ResourceController, Platform::RolesController, Platform::StatesController, Platform::TaxonsController, Platform::UsersController, Platform::ZonesController, Storefront::Account::AddressesController, Storefront::Account::CreditCardsController, Storefront::Account::OrdersController, Storefront::AccountController, Storefront::CmsPagesController, Storefront::CountriesController, Storefront::DigitalsController, Storefront::MenusController, Storefront::OrderStatusController, Storefront::ProductsController, Storefront::StoresController, Storefront::TaxonsController, Storefront::WishlistsController
Instance Method Summary collapse
Methods included from Caching
#collection_cache_key, #collection_cache_opts
Methods included from CollectionOptionsHelpers
#collection_links, #collection_meta, #collection_permitted_params
Methods inherited from BaseController
Instance Method Details
#index ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/spree/api/v2/resource_controller.rb', line 8 def index render_serialized_payload do Rails.cache.fetch(collection_cache_key(paginated_collection), collection_cache_opts) do serialize_collection(paginated_collection) end end end |
#show ⇒ Object
16 17 18 |
# File 'app/controllers/spree/api/v2/resource_controller.rb', line 16 def show render_serialized_payload { serialize_resource(resource) } end |