Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add same item in cart #2610

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8865db8
geml update & specify the version of sqlite
Jayyyy1011 Dec 5, 2019
855e8af
add bootstrap to project
Jayyyy1011 Dec 5, 2019
dddab95
add bootstrap html
Jayyyy1011 Dec 5, 2019
4e5f271
add bootstrap flash function
Jayyyy1011 Dec 5, 2019
3036a3e
correct the flash function
Jayyyy1011 Dec 5, 2019
e2e183f
user can login/logout/signup
Jayyyy1011 Dec 5, 2019
b869f2a
install simpleform with bootstrap
Jayyyy1011 Dec 5, 2019
9a46ace
install font-awesome-rails
Jayyyy1011 Dec 5, 2019
8dc6830
first hw
Jayyyy1011 Dec 5, 2019
c1eaec6
implement backend CRUD
Jayyyy1011 Dec 9, 2019
2fc41d5
only admin can access backend panel
Jayyyy1011 Dec 9, 2019
f511018
implement image upload
Jayyyy1011 Dec 9, 2019
925918d
implement product show
Jayyyy1011 Dec 9, 2019
59376c7
correct update function
Jayyyy1011 Dec 9, 2019
bf15f73
implement add_product_to_cart function
Jayyyy1011 Dec 10, 2019
3251f2c
implement current_cart function
Jayyyy1011 Dec 10, 2019
d87fdb7
implement carts index function
Jayyyy1011 Dec 10, 2019
c58364b
implement cart_total_price function
Jayyyy1011 Dec 10, 2019
f38fda3
first week
Jayyyy1011 Dec 14, 2019
f960435
add clear all cart_itemss btn
Jayyyy1011 Dec 14, 2019
d0ac357
clear all carts_items
Jayyyy1011 Dec 14, 2019
b0ed28b
pull request HW
Jayyyy1011 Dec 14, 2019
6ae1fe6
correct REAME
Jayyyy1011 Dec 14, 2019
d6db48f
delete an titem form cart
Jayyyy1011 Dec 14, 2019
1e00607
modify READMEE
Jayyyy1011 Dec 14, 2019
c3fccb1
cannt add same item in cart
Jayyyy1011 Dec 14, 2019
122390c
modify README
Jayyyy1011 Dec 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
# Ignore Byebug command history file.
.byebug_history
config/database.yml
public/uploads
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'sqlite3', '1.3.13'
# Use Puma as the app server
gem 'puma', '~> 3.0'
gem 'puma', '4.2.1'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand All @@ -29,6 +29,12 @@ gem 'jbuilder', '~> 2.5'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'bootstrap-sass'
gem 'devise'
gem 'simple_form'
gem 'font-awesome-rails'
gem 'carrierwave'
gem 'mini_magick'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
252 changes: 151 additions & 101 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,175 +1,225 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.0)
actionpack (= 5.0.0)
nio4r (~> 1.2)
actioncable (5.0.7.2)
actionpack (= 5.0.7.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.0)
actionview (= 5.0.0)
activesupport (= 5.0.0)
actionpack (5.0.7.2)
actionview (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.0)
activesupport (= 5.0.0)
actionview (5.0.7.2)
activesupport (= 5.0.7.2)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (5.0.0)
activesupport (= 5.0.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.7.2)
activesupport (= 5.0.7.2)
globalid (>= 0.3.6)
activemodel (5.0.0)
activesupport (= 5.0.0)
activerecord (5.0.0)
activemodel (= 5.0.0)
activesupport (= 5.0.0)
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activesupport (5.0.0)
activesupport (5.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.1)
builder (3.2.2)
byebug (9.0.5)
coffee-rails (4.2.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (7.1.4)
autoprefixer-rails (9.7.3)
execjs
bcrypt (3.1.13)
bindex (0.8.1)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.3)
byebug (11.0.1)
carrierwave (2.0.2)
activemodel (>= 5.0.0)
activesupport (>= 5.0.0)
addressable (~> 2.6)
image_processing (~> 1.1)
mimemagic (>= 0.3.0)
mini_mime (>= 0.1.3)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
crass (1.0.5)
devise (4.7.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.1)
ffi (1.11.3)
font-awesome-rails (4.7.0.5)
railties (>= 3.2, < 6.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
image_processing (1.9.3)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.13, < 3)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_json (1.12.1)
nio4r (1.2.1)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
pkg-config (1.1.7)
puma (3.6.0)
rack (2.0.1)
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.2)
mimemagic (0.3.3)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
nio4r (2.5.2)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
public_suffix (4.0.1)
puma (4.2.1)
nio4r (~> 2.0)
rack (2.0.7)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0)
actioncable (= 5.0.0)
actionmailer (= 5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
activemodel (= 5.0.0)
activerecord (= 5.0.0)
activesupport (= 5.0.0)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0)
rails (5.0.7.2)
actioncable (= 5.0.7.2)
actionmailer (= 5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
activemodel (= 5.0.7.2)
activerecord (= 5.0.7.2)
activesupport (= 5.0.7.2)
bundler (>= 1.3.0)
railties (= 5.0.7.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0)
actionpack (= 5.0.0)
activesupport (= 5.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.0.7.2)
actionpack (= 5.0.7.2)
activesupport (= 5.0.7.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.2.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
sass (3.4.22)
sass-rails (5.0.6)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
ruby-vips (2.0.16)
ffi (~> 1.9)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (1.7.2)
spring-watcher-listen (2.0.0)
sassc (2.2.1)
ffi (~> 1.9)
simple_form (5.0.1)
actionpack (>= 5.0)
activemodel (>= 5.0)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (~> 1.2)
sprockets (3.7.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.0)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
sqlite3 (1.3.13)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.10)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
web-console (3.3.1)
warden (1.2.8)
rack (>= 2.0.6)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
debug_inspector
bindex (>= 0.4.0)
railties (>= 5.0)
websocket-driver (0.6.4)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
websocket-extensions (0.1.4)

PLATFORMS
ruby

DEPENDENCIES
bootstrap-sass
byebug
carrierwave
coffee-rails (~> 4.2)
devise
font-awesome-rails
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
puma (~> 3.0)
mini_magick
puma (= 4.2.1)
rails (~> 5.0.0)
sass-rails (~> 5.0)
simple_form
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
sqlite3 (= 1.3.13)
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console

BUNDLED WITH
1.12.5
1.17.3
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# README

This README would normally document whatever steps are necessary to get the
application up and running.

Things you may want to cover:

* Ruby version

* System dependencies

* Configuration

* Database creation

* Database initialization

* How to run the test suite

* Services (job queues, cache servers, search engines, etc.)

* Deployment instructions

* ...
cant add same item in cart
3 changes: 3 additions & 0 deletions app/assets/javascripts/admin/products.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap/alert
//= require bootstrap/dropdown
//= require_tree .
3 changes: 3 additions & 0 deletions app/assets/javascripts/cart_items.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
Loading