Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VietTH-VenShop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tran Hoang Viet
VietTH-VenShop
Commits
f5b846b1
Commit
f5b846b1
authored
Jul 13, 2015
by
Tran Hoang Viet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VietTH: Hotfix add breadcrumb to search and category detail page
parent
e8b8f19a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
app/controllers/categories_controller.rb
+2
-0
app/controllers/products_controller.rb
+1
-0
db/schema.rb
+2
-2
No files found.
app/controllers/categories_controller.rb
View file @
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
...
...
app/controllers/products_controller.rb
View file @
f5b846b1
...
@@ -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
...
...
db/schema.rb
View file @
f5b846b1
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment