Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Venshop.v2
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
Vy Quoc Vu
Venshop.v2
Commits
23c96f32
Commit
23c96f32
authored
Aug 05, 2015
by
Vy Quoc Vu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solr
parent
7f6a553a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
4 deletions
+7
-4
app/controllers/cart_products_controller.rb
+0
-1
app/controllers/carts_controller.rb
+1
-0
app/views/admins/products/show.html.erb
+1
-1
app/views/layouts/_header.html.erb
+1
-0
db/migrate/20150724033606_devise_create_users.rb
+1
-2
db/migrate/20150730041232_devise_create_admins.rb
+1
-0
db/schema.rb
+2
-0
No files found.
app/controllers/cart_products_controller.rb
View file @
23c96f32
...
...
@@ -31,7 +31,6 @@ class CartProductsController < ApplicationController
end
def
update
byebug
if
params
[
:id
].
nil?
flash
[
:danger
]
=
"Product not found!"
elsif
params
[
:new_quantity
].
nil?
||
params
[
:new_quantity
].
to_i
<=
0
...
...
app/controllers/carts_controller.rb
View file @
23c96f32
...
...
@@ -30,6 +30,7 @@ class CartsController < ApplicationController
Emailer
.
send_email_to
(
cart_params
[
:mail
].
to_s
,
session
[
:cart
]).
deliver
flash
[
:success
]
=
"Success!"
session
[
:cart
]
=
nil
redirect_to
:action
=>
"show"
else
flash
[
:danger
]
=
"Your mail, your address, your name"
redirect_to
:back
...
...
app/views/admins/products/show.html.erb
View file @
23c96f32
...
...
@@ -11,7 +11,7 @@
<%=
f
.
label
:price
%>
<%=
f
.
number_field
:price
,
value:
@product
.
price
/
100
,
class:
'form-control'
%>
<br>
<%=
f
.
label
:Category
%>
<%=
f
.
label
:Category
%>
<p>
</p>
<%=
collection_select
:category
,
:id
,
Category
.
all
,
:id
,
:name
,
:selected
=>
@product
.
category_id
%>
</br>
...
...
app/views/layouts/_header.html.erb
View file @
23c96f32
...
...
@@ -6,6 +6,7 @@
<div
class=
"navbar-header"
>
<table>
<td><a
class=
"navbar-brand"
href=
"/"
>
Venshop
</a></td>
<td></td>
<form
action=
"/search"
style=
"padding-left : 100px ; resize: vertical;"
method=
"get"
class=
"navbar-brand"
>
<td
><input
type=
"text"
name=
"search"
value=
""
,
class=
"form-control"
/></td>
<td
style=
"padding-left : 20px"
><input
type=
"submit"
value=
"Search"
style=
"font-size: 1em;"
,
class=
"btn btn-primary"
/></td>
...
...
db/migrate/20150724033606_devise_create_users.rb
View file @
23c96f32
...
...
@@ -4,8 +4,7 @@ class DeviseCreateUsers < ActiveRecord::Migration
## Database authenticatable
t
.
string
:email
,
null:
false
,
default:
""
t
.
string
:encrypted_password
,
null:
false
,
default:
""
t
.
string
:name
t
.
string
:address
t
.
string
:name
,
default:
"Username"
## Recoverable
t
.
string
:reset_password_token
...
...
db/migrate/20150730041232_devise_create_admins.rb
View file @
23c96f32
...
...
@@ -4,6 +4,7 @@ class DeviseCreateAdmins < ActiveRecord::Migration
## Database authenticatable
t
.
string
:email
,
null:
false
,
default:
""
t
.
string
:encrypted_password
,
null:
false
,
default:
""
t
.
string
:name
,
default:
"adminname"
## Recoverable
t
.
string
:reset_password_token
...
...
db/schema.rb
View file @
23c96f32
...
...
@@ -16,6 +16,7 @@ ActiveRecord::Schema.define(version: 20150730041232) do
create_table
"admins"
,
force: :cascade
do
|
t
|
t
.
string
"email"
,
limit:
255
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
limit:
255
,
default:
""
,
null:
false
t
.
string
"name"
,
limit:
255
,
default:
"adminname"
t
.
string
"reset_password_token"
,
limit:
255
t
.
datetime
"reset_password_sent_at"
t
.
datetime
"remember_created_at"
...
...
@@ -72,6 +73,7 @@ ActiveRecord::Schema.define(version: 20150730041232) do
create_table
"users"
,
force: :cascade
do
|
t
|
t
.
string
"email"
,
limit:
255
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
limit:
255
,
default:
""
,
null:
false
t
.
string
"name"
,
limit:
255
,
default:
"Username"
t
.
string
"reset_password_token"
,
limit:
255
t
.
datetime
"reset_password_sent_at"
t
.
datetime
"remember_created_at"
...
...
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