Class: Spree::StoreController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::StoreController
show all
- Includes:
- Core::ControllerHelpers::Order
- Defined in:
- app/controllers/spree/store_controller.rb
Instance Method Summary
collapse
Instance Method Details
#account_link ⇒ Object
15
16
17
18
|
# File 'app/controllers/spree/store_controller.rb', line 15
def account_link
render partial: 'spree/shared/link_to_account'
fresh_when(try_spree_current_user)
end
|
#api_tokens ⇒ Object
25
26
27
28
29
30
|
# File 'app/controllers/spree/store_controller.rb', line 25
def api_tokens
render json: {
order_token: simple_current_order&.token,
oauth_token: current_oauth_token&.token
}
end
|
#cart_link ⇒ Object
20
21
22
23
|
# File 'app/controllers/spree/store_controller.rb', line 20
def cart_link
render partial: 'spree/shared/link_to_cart'
fresh_when(simple_current_order)
end
|
#ensure_cart ⇒ Object
32
33
34
|
# File 'app/controllers/spree/store_controller.rb', line 32
def ensure_cart
render json: current_order(create_order_if_necessary: true) end
|
#forbidden ⇒ Object
7
8
9
|
# File 'app/controllers/spree/store_controller.rb', line 7
def forbidden
render 'spree/shared/forbidden', layout: Spree::Config[:layout], status: 403
end
|
#unauthorized ⇒ Object
11
12
13
|
# File 'app/controllers/spree/store_controller.rb', line 11
def unauthorized
render 'spree/shared/unauthorized', layout: Spree::Config[:layout], status: 401
end
|