code breadcrumb
Showing
| ... | ... | @@ -55,3 +55,4 @@ end |
| gem 'will_paginate', '3.0.4' | ||
| gem 'will_paginate-bootstrap' | ||
| gem 'recaptcha-mailhide' | ||
| gem "breadcrumbs_on_rails" | ||
| \ No newline at end of file |
| ... | ... | @@ -55,3 +55,4 @@ end |
| gem 'will_paginate', '3.0.4' | ||
| gem 'will_paginate-bootstrap' | ||
| gem 'recaptcha-mailhide' | ||
| gem "breadcrumbs_on_rails" | ||
| \ No newline at end of file |
| class ProductsController < ApplicationController | ||
| add_breadcrumb "Products", :products_path | ||
| def index | ||
| @products = Product.get_list(limit: 16, page: params[:page]) | ||
| end | ||
| def show | ||
| @product = Product.find(params[:id]) | ||
Please
register
or
sign in
to reply
|
||
| product_category = ProductCategory.find(@product.product_category_id) | ||
| if product_category != nil | ||
|
||
| add_breadcrumb product_category.name, product_category_path(product_category) | ||
| add_breadcrumb @product.name, product_path(@product) | ||
| end | ||
| @other_products = Product.get_other_products(@product.id, product_category_id: @product.product_category_id, limit: 16) | ||
| end | ||
| end | ||