Class: Workarea::Api::Storefront::CategoriesController
- Inherits:
-
ApplicationController
- Object
- Workarea::ApplicationController
- ApplicationController
- Workarea::Api::Storefront::CategoriesController
- Defined in:
- app/controllers/workarea/api/storefront/categories_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from UserActivity
#assert_current_user_activity_id, #current_user_activity_id, #user_activity
Methods included from Authentication
#authentication?, #current_user
Instance Method Details
#index ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/workarea/api/storefront/categories_controller.rb', line 7 def index models = Catalog::Category.active.page(params[:page]) @categories = Workarea::Storefront::CategoryViewModel.wrap( models, ) end |
#show ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/workarea/api/storefront/categories_controller.rb', line 15 def show model = Catalog::Category.find_by(slug: params[:id]) @category = Workarea::Storefront::CategoryViewModel.wrap( model, ) end |