Class: Workarea::Storefront::ProductsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Workarea::Storefront::ProductsController
- Defined in:
- app/controllers/workarea/storefront/products_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_layout, #current_user_info, #health_check, #layout_content
Methods included from OrderLookup
Methods included from CurrentCheckout
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout
Instance Method Details
#details ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/workarea/storefront/products_controller.rb', line 15 def details model = Catalog::Product.find_by(slug: params[:id]) raise InvalidDisplay unless model.active? || current_user.try(:admin?) @product = Storefront::ProductViewModel.wrap( model, ) end |
#show ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/workarea/storefront/products_controller.rb', line 5 def show model = Catalog::Product.find_by(slug: params[:id]) raise InvalidDisplay unless model.active? || current_user.try(:admin?) @product = Storefront::ProductViewModel.wrap( model, ) end |