Class: Spree::StoreController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Spree::StoreController
show all
- Includes:
- Core::ControllerHelpers::Auth, Core::ControllerHelpers::Currency, Core::ControllerHelpers::Locale, Core::ControllerHelpers::Order, Core::ControllerHelpers::Search, Core::ControllerHelpers::Store, Core::ControllerHelpers::StrongParameters, LocaleUrls
- Defined in:
- app/controllers/spree/store_controller.rb
Direct Known Subclasses
AddressesController, CheckoutController, CmsPagesController, ContentController, CurrencyController, ErrorsController, HomeController, LocaleController, OrdersController, ProductsController, TaxonsController
Instance Method Summary
collapse
Instance Method Details
#account_link ⇒ Object
28
29
30
31
|
# File 'app/controllers/spree/store_controller.rb', line 28
def account_link
render partial: 'spree/shared/link_to_account'
fresh_when(etag: [try_spree_current_user, I18n.locale])
end
|
#api_tokens ⇒ Object
38
39
40
41
42
43
|
# File 'app/controllers/spree/store_controller.rb', line 38
def api_tokens
render json: {
order_token: simple_current_order&.token,
oauth_token: current_oauth_token&.token
}
end
|
#cart_link ⇒ Object
33
34
35
36
|
# File 'app/controllers/spree/store_controller.rb', line 33
def cart_link
render partial: 'spree/shared/link_to_cart'
fresh_when(etag: [simple_current_order, I18n.locale])
end
|
#ensure_cart ⇒ Object
45
46
47
|
# File 'app/controllers/spree/store_controller.rb', line 45
def ensure_cart
render json: current_order(create_order_if_necessary: true) end
|