From f4cc8a9a272a1e9c4e5f6545ca7034b1f67040d9 Mon Sep 17 00:00:00 2001 From: benji Date: Fri, 3 Apr 2015 21:27:03 +0200 Subject: [PATCH] Fix #43 --- Gemfile | 61 ++++++++++++++++++-------------- app/views/orders/_price.html.erb | 2 +- db/seeds.rb | 24 ++++++------- 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/Gemfile b/Gemfile index 92946fd..1dff6c0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,41 +3,35 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2' + # Use sqlite3 as the database for Active Record gem 'sqlite3' + # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.3' +gem 'bootstrap-sass', '3.2.0.0' + # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' + # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 4.0.0' -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby +# Responders gem 'responders', '~> 2.0' # Use jquery as the JavaScript library gem 'jquery-rails' + # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' + # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' -# bundle exec rake doc:rails generates the API under doc/api. -gem 'sdoc', '~> 0.4.0', group: :doc -# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring -gem 'spring', group: :development - -# add annotations of schema inside models -gem 'annotate' - -gem 'airbrake' - -# Deployment -gem 'capistrano', '~> 3.1' -gem 'capistrano-rails', '~> 1.1' -gem 'capistrano-rvm' -gem 'capistrano-passenger' +group :doc do + gem 'sdoc', '~> 0.4.0' +end group :production do gem 'mysql2' # Database @@ -49,23 +43,38 @@ group :test do gem "codeclimate-test-reporter", require: nil end +group :development do + gem 'annotate' +end + +# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring +gem 'spring', group: :development + +# Airbrake +gem 'airbrake' + +# Deployment +gem 'capistrano', '~> 3.1' +gem 'capistrano-rails', '~> 1.1' +gem 'capistrano-rvm' +gem 'capistrano-passenger' + +# Generate seed data gem 'faker', '1.4.2' -#bootstrap -gem 'bootstrap-sass', '3.2.0.0' - -#debug stuff +# Debug stuff gem 'byebug' -#paginate stuff +# Paginate stuff gem 'will_paginate', '3.0.7' gem 'bootstrap-will_paginate', '0.0.10' -# paperclip for easy file attachment +# Paperclip for easy file attachment gem 'paperclip' -# Use devise for Admins +# Use devise for users and admins gem 'devise' +gem 'omniauth-oauth2' # Use cancancan for authorization gem 'cancancan' @@ -76,8 +85,8 @@ gem 'paper_trail', '~> 4.0.0.beta' # Windoos sux gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw] +# Coveralls gem 'coveralls', require: false -gem 'omniauth-oauth2' - +# Default avatar for users gem 'identicon' diff --git a/app/views/orders/_price.html.erb b/app/views/orders/_price.html.erb index 67e1ff5..e5d9862 100644 --- a/app/views/orders/_price.html.erb +++ b/app/views/orders/_price.html.erb @@ -2,7 +2,7 @@ <%= f.label :total_price %>
- <%= f.number_field :price, skip_label: true, step: :any, class: 'form-control big-form-field' %> + <%= f.number_field :price, disabled: true, skip_label: true, step: :any, class: 'form-control big-form-field' %> <%= f.submit "Order!", class: "btn btn-primary big-form-button" %> diff --git a/db/seeds.rb b/db/seeds.rb index 9873c81..f3a6e0b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,84 +14,84 @@ products = [ name: "Twix", price: 0.4, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/1.jpg', 'r') }, { name: "M&M Peanuts", price: 0.6, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/2.jpg', 'r') }, { name: "Snickers", price: 0.4, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/3.jpg', 'r') }, { name: "Fanta", price: 0.6, category: "beverages", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/4.jpg', 'r') }, { name: "Ice Tea", price: 0.7, category: "beverages", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/5.jpg', 'r') }, { name: "Cola", price: 0.6, category: "beverages", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/6.jpg', 'r') }, { name: "Abrikozencake", price: 0.4, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/7.jpg', 'r') }, { name: "Kinder Delice", price: 0.4, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/8.jpg', 'r') }, { name: "Kinder Bueno", price: 0.6, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/9.jpg', 'r') }, { name: "Arizona Ice Tea", price: 1.0, category: "beverages", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/10.png', 'r') }, { name: "Dinosauruskoeken", price: 0.5, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/11.jpg', 'r') }, { name: "Chocolade - melk", price: 0.7, category: "food", - stock: 0, + stock: 30, avatar: File.new('public/seeds/products/12.jpg', 'r') } ]