VietTH: Feature search
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
Status changed to merged
Toggle commit list
| 1 | class CategoriesController < ApplicationController | |
| 2 | before_action :set_category, only: [:show] | |
| 3 | ||
| 4 | def show | |
| 5 | @products = @category.products.page(params[:page]) | |
| 6 | end | |
| 7 | ||
| 8 | private | |
| 9 | def set_category | |
| 10 | @category = Category.find_by(id: params[:id]) | |
| 11 | redirect_to root_path, alert: "Category not found" if @category.blank? | |
Please
register
or
sign in
to reply
|
||
| 1 | class CategoriesController < ApplicationController | |
| 2 | before_action :set_category, only: [:show] | |
| 3 | ||
| 4 | def show | |
| 5 | @products = @category.products.page(params[:page]) | |
| 6 | end | |
| 7 | ||
| 8 | private | |
| 9 | def set_category | |
| 10 | @category = Category.find_by(id: params[:id]) | |
| 11 | redirect_to root_path, alert: "Category not found" if @category.blank? | |
|
||
Added 6 commits:
Status changed to merged
Status changed to merged
mentioned in commit 3b19a49d
mentioned in commit 3b19a49d