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
#api_tokens ⇒ Object
21
22
23
24
25
26
|
# File 'app/controllers/spree/store_controller.rb', line 21
def api_tokens
render json: {
order_token: current_order&.token,
oauth_token: current_oauth_token&.token
}
end
|
#cart_link ⇒ Object
16
17
18
19
|
# File 'app/controllers/spree/store_controller.rb', line 16
def cart_link
render partial: 'spree/shared/link_to_cart'
fresh_when(simple_current_order)
end
|
#ensure_cart ⇒ Object
28
29
30
|
# File 'app/controllers/spree/store_controller.rb', line 28
def ensure_cart
render json: current_order(create_order_if_necessary: true) end
|
#forbidden ⇒ Object
8
9
10
|
# File 'app/controllers/spree/store_controller.rb', line 8
def forbidden
render 'spree/shared/forbidden', layout: Spree::Config[:layout], status: 403
end
|
#unauthorized ⇒ Object
12
13
14
|
# File 'app/controllers/spree/store_controller.rb', line 12
def unauthorized
render 'spree/shared/unauthorized', layout: Spree::Config[:layout], status: 401
end
|