Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
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
0
Merge Requests
0
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
huanvl
venshop
Commits
79806f7d
Commit
79806f7d
authored
Nov 11, 2013
by
vulehuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error occured when using mongodb
parent
15fbdf8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
venshop_app/app/controllers/cards_controller.rb
+2
-2
No files found.
venshop_app/app/controllers/cards_controller.rb
View file @
79806f7d
...
@@ -7,7 +7,7 @@ class CardsController < ApplicationController
...
@@ -7,7 +7,7 @@ class CardsController < ApplicationController
@card_infos
=
session
[
:SHOPPING_CARD_SESSION_NAME
]
@card_infos
=
session
[
:SHOPPING_CARD_SESSION_NAME
]
end
end
unless
params
[
:product_id
].
blank?
unless
params
[
:product_id
].
blank?
if
Product
.
exists?
(
params
[
:product_id
])
if
Product
.
where
(
id:
params
[
:product_id
]).
exists?
# if remove a product from card
# if remove a product from card
if
!
params
[
:card_action
].
blank?
&&
params
[
:card_action
]
==
'remove'
if
!
params
[
:card_action
].
blank?
&&
params
[
:card_action
]
==
'remove'
# Nothing to delete
# Nothing to delete
...
@@ -183,7 +183,7 @@ class CardsController < ApplicationController
...
@@ -183,7 +183,7 @@ class CardsController < ApplicationController
end
end
def
thankyou
def
thankyou
if
params
[
:card_id
].
blank?
||
!
MyCard
.
exists?
(
params
[
:card_id
])
if
params
[
:card_id
].
blank?
||
!
MyCard
.
where
(
id:
params
[
:card_id
]).
exists?
flash
[
:error
]
=
"Invalid card request"
flash
[
:error
]
=
"Invalid card request"
redirect_to
root_path
and
return
redirect_to
root_path
and
return
end
end
...
...
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