Class: Workarea::Api::Storefront::ApplicationController
- Inherits:
-
Workarea::ApplicationController
- Object
- Workarea::ApplicationController
- Workarea::Api::Storefront::ApplicationController
show all
- Includes:
- HttpCaching, Authentication
- Defined in:
- app/controllers/workarea/api/storefront/application_controller.rb
Direct Known Subclasses
AccountsController, AnalyticsController, AssetsController, AuthenticationTokensController, CartItemsController, CartsController, CategoriesController, CheckoutsController, ContactsController, EmailSignupsController, MenusController, OrdersController, PagesController, PasswordResetsController, ProductsController, RecentViewsController, RecommendationsController, SavedAddressesController, SavedCreditCardsController, SearchesController, SystemContentController, TaxonsController
Instance Method Summary
collapse
#authentication?, #current_user, find_user
Instance Method Details
#assert_current_metrics_id ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 31
def assert_current_metrics_id
if current_metrics_id.blank?
render(
json: {
problem: t('workarea.api.storefront.recent_views.missing_id')
},
status: :unprocessable_entity
)
return false
end
end
|
#cache_page ⇒ Object
23
24
25
|
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 23
def cache_page
expires_in Workarea.config.page_cache_ttl, public: true
end
|
#skip_session ⇒ Object
27
28
29
|
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 27
def skip_session
request.session_options[:skip] = true
end
|