Commit 0b28f610 by Tran Hoang Viet

Merge remote-tracking branch 'origin/hotfix-1.0.0'

parents ff08b7a1 f5b846b1
class CategoriesController < ApplicationController class CategoriesController < ApplicationController
before_action :set_category, only: [:show] before_action :set_category, only: [:show]
before_action :add_breadcrumb_home
def show def show
@products = @category.products.page(params[:page]) @products = @category.products.page(params[:page])
add_breadcrumb(@category.title)
end end
private private
......
...@@ -33,6 +33,7 @@ class ProductsController < ApplicationController ...@@ -33,6 +33,7 @@ class ProductsController < ApplicationController
def search def search
query = params[:query].present? ? {title: params[:query]} : '*' query = params[:query].present? ? {title: params[:query]} : '*'
@products = Product.search(query, page: params[:page]) @products = Product.search(query, page: params[:page])
add_breadcrumb('Search result')
end end
private private
......
...@@ -46,12 +46,12 @@ ActiveRecord::Schema.define(version: 20150708092744) do ...@@ -46,12 +46,12 @@ ActiveRecord::Schema.define(version: 20150708092744) do
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.string "asin", limit: 255 t.string "asin", limit: 255
t.string "title", limit: 255 t.string "title", limit: 255, null: false
t.string "image_lg_url", limit: 255 t.string "image_lg_url", limit: 255
t.string "image_md_url", limit: 255 t.string "image_md_url", limit: 255
t.string "image_sm_url", limit: 255 t.string "image_sm_url", limit: 255
t.decimal "price", precision: 10, default: 0 t.decimal "price", precision: 10, default: 0
t.integer "category_id", limit: 4 t.integer "category_id", limit: 4, null: false
t.integer "product_type", limit: 4, default: 0 t.integer "product_type", limit: 4, default: 0
t.string "image", limit: 255 t.string "image", limit: 255
t.integer "user_id", limit: 4 t.integer "user_id", limit: 4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment