From 6d9c1285f9b7f650bf4580ea4eaf5601f17f7614 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Tue, 4 Oct 2016 12:14:26 -0700 Subject: [PATCH 01/43] Created models and relationships between models. Have not migrated. --- app/models/market.rb | 3 +++ app/models/product.rb | 4 ++++ app/models/sale.rb | 3 +++ app/models/vendor.rb | 4 ++++ db/migrate/20161004190501_create_markets.rb | 14 ++++++++++++++ db/migrate/20161004190547_create_vendors.rb | 13 +++++++++++++ db/migrate/20161004190612_create_products.rb | 12 ++++++++++++ db/migrate/20161004190718_create_sales.rb | 14 ++++++++++++++ test/fixtures/markets.yml | 17 +++++++++++++++++ test/fixtures/products.yml | 9 +++++++++ test/fixtures/sales.yml | 13 +++++++++++++ test/fixtures/vendors.yml | 11 +++++++++++ test/models/market_test.rb | 7 +++++++ test/models/product_test.rb | 7 +++++++ test/models/sale_test.rb | 7 +++++++ test/models/vendor_test.rb | 7 +++++++ 16 files changed, 145 insertions(+) create mode 100644 app/models/market.rb create mode 100644 app/models/product.rb create mode 100644 app/models/sale.rb create mode 100644 app/models/vendor.rb create mode 100644 db/migrate/20161004190501_create_markets.rb create mode 100644 db/migrate/20161004190547_create_vendors.rb create mode 100644 db/migrate/20161004190612_create_products.rb create mode 100644 db/migrate/20161004190718_create_sales.rb create mode 100644 test/fixtures/markets.yml create mode 100644 test/fixtures/products.yml create mode 100644 test/fixtures/sales.yml create mode 100644 test/fixtures/vendors.yml create mode 100644 test/models/market_test.rb create mode 100644 test/models/product_test.rb create mode 100644 test/models/sale_test.rb create mode 100644 test/models/vendor_test.rb diff --git a/app/models/market.rb b/app/models/market.rb new file mode 100644 index 00000000..6a148291 --- /dev/null +++ b/app/models/market.rb @@ -0,0 +1,3 @@ +class Market < ActiveRecord::Base + has_many :vendors +end diff --git a/app/models/product.rb b/app/models/product.rb new file mode 100644 index 00000000..86f8d94b --- /dev/null +++ b/app/models/product.rb @@ -0,0 +1,4 @@ +class Product < ActiveRecord::Base + belongs_to :vendor + has_many :sales +end diff --git a/app/models/sale.rb b/app/models/sale.rb new file mode 100644 index 00000000..27888ff7 --- /dev/null +++ b/app/models/sale.rb @@ -0,0 +1,3 @@ +class Sale < ActiveRecord::Base + belongs_to :product, :vendor +end diff --git a/app/models/vendor.rb b/app/models/vendor.rb new file mode 100644 index 00000000..ce34099d --- /dev/null +++ b/app/models/vendor.rb @@ -0,0 +1,4 @@ +class Vendor < ActiveRecord::Base + belongs_to :market + has_many :products, :sales +end diff --git a/db/migrate/20161004190501_create_markets.rb b/db/migrate/20161004190501_create_markets.rb new file mode 100644 index 00000000..8155ce25 --- /dev/null +++ b/db/migrate/20161004190501_create_markets.rb @@ -0,0 +1,14 @@ +class CreateMarkets < ActiveRecord::Migration + def change + create_table :markets do |t| + t.string :name + t.string :address + t.string :city + t.string :county + t.string :state + t.string :zip + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004190547_create_vendors.rb b/db/migrate/20161004190547_create_vendors.rb new file mode 100644 index 00000000..67dd8020 --- /dev/null +++ b/db/migrate/20161004190547_create_vendors.rb @@ -0,0 +1,13 @@ +class CreateVendors < ActiveRecord::Migration + def change + create_table :vendors do |t| + t.belongs_to :market + + t.string :name + t.integer :num_employees + t.integer :market_id + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004190612_create_products.rb b/db/migrate/20161004190612_create_products.rb new file mode 100644 index 00000000..79a5a3ac --- /dev/null +++ b/db/migrate/20161004190612_create_products.rb @@ -0,0 +1,12 @@ +class CreateProducts < ActiveRecord::Migration + def change + create_table :products do |t| + t.belongs_to :vendor + + t.string :name + t.integer :vendor_id + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004190718_create_sales.rb b/db/migrate/20161004190718_create_sales.rb new file mode 100644 index 00000000..1f75190c --- /dev/null +++ b/db/migrate/20161004190718_create_sales.rb @@ -0,0 +1,14 @@ +class CreateSales < ActiveRecord::Migration + def change + create_table :sales do |t| + t.belongs_to :product, :vendor + + t.integer :amount + t.datetime :purchase_time + t.integer :vendor_id + t.integer :product_id + + t.timestamps null: false + end + end +end diff --git a/test/fixtures/markets.yml b/test/fixtures/markets.yml new file mode 100644 index 00000000..13e26ee7 --- /dev/null +++ b/test/fixtures/markets.yml @@ -0,0 +1,17 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + address: MyString + city: MyString + county: MyString + state: MyString + zip: MyString + +two: + name: MyString + address: MyString + city: MyString + county: MyString + state: MyString + zip: MyString diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml new file mode 100644 index 00000000..3e906fd1 --- /dev/null +++ b/test/fixtures/products.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + vendor_id: 1 + +two: + name: MyString + vendor_id: 1 diff --git a/test/fixtures/sales.yml b/test/fixtures/sales.yml new file mode 100644 index 00000000..412e9e21 --- /dev/null +++ b/test/fixtures/sales.yml @@ -0,0 +1,13 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + amount: 1 + purchase_time: 2016-10-04 12:07:18 + vendor_id: 1 + product_id: 1 + +two: + amount: 1 + purchase_time: 2016-10-04 12:07:18 + vendor_id: 1 + product_id: 1 diff --git a/test/fixtures/vendors.yml b/test/fixtures/vendors.yml new file mode 100644 index 00000000..b36e126a --- /dev/null +++ b/test/fixtures/vendors.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + num_employees: 1 + market_id: 1 + +two: + name: MyString + num_employees: 1 + market_id: 1 diff --git a/test/models/market_test.rb b/test/models/market_test.rb new file mode 100644 index 00000000..62e16016 --- /dev/null +++ b/test/models/market_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MarketTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/product_test.rb b/test/models/product_test.rb new file mode 100644 index 00000000..211cdd0b --- /dev/null +++ b/test/models/product_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/sale_test.rb b/test/models/sale_test.rb new file mode 100644 index 00000000..8f0c60c0 --- /dev/null +++ b/test/models/sale_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SaleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/vendor_test.rb b/test/models/vendor_test.rb new file mode 100644 index 00000000..07dd4193 --- /dev/null +++ b/test/models/vendor_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class VendorTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 4c254b8cfc2be6bcd8524826149329bf92c39d1b Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Tue, 4 Oct 2016 12:15:24 -0700 Subject: [PATCH 02/43] Migrated tables. --- db/schema.rb | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 db/schema.rb diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 00000000..b5075535 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,51 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20161004190718) do + + create_table "markets", force: :cascade do |t| + t.string "name" + t.string "address" + t.string "city" + t.string "county" + t.string "state" + t.string "zip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "products", force: :cascade do |t| + t.integer "vendor_id" + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "sales", force: :cascade do |t| + t.integer "product_id" + t.integer "vendor_id" + t.integer "amount" + t.datetime "purchase_time" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "vendors", force: :cascade do |t| + t.integer "market_id" + t.string "name" + t.integer "num_employees" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end From c6f719259a85c9a693ebd9c8b2fa79f1062ebd51 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Tue, 4 Oct 2016 14:25:07 -0700 Subject: [PATCH 03/43] Route setup, try #1. --- config/routes.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index 3f66539d..b2cb8105 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,24 @@ Rails.application.routes.draw do + + # Acting as a market + resources :market do + resources :vendor, only: [:new, :create, :edit, :delete] do + # resources :product, :sale, only: [:new, :create, :edit, :delete] do + # resources :sale, only: [:new, :create, :edit, :delete] + # end + end + end + + + # Acting as a Vendor + resources :vendor do + resources :product, :sale, only: [:new, :create, :edit, :delete] do + resources :sale, only: [:new, :create, :edit, :delete] + end + end + + + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". From 2561eaec984a4042d90fd671375bb23bc124f24a Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Tue, 4 Oct 2016 14:34:09 -0700 Subject: [PATCH 04/43] Created empty controllers for market, vendor, product, sale --- app/assets/javascripts/market.coffee | 3 +++ app/assets/javascripts/product.coffee | 3 +++ app/assets/javascripts/sale.coffee | 3 +++ app/assets/javascripts/vendor.coffee | 3 +++ app/assets/stylesheets/market.scss | 3 +++ app/assets/stylesheets/product.scss | 3 +++ app/assets/stylesheets/sale.scss | 3 +++ app/assets/stylesheets/vendor.scss | 3 +++ app/controllers/market_controller.rb | 2 ++ app/controllers/product_controller.rb | 2 ++ app/controllers/sale_controller.rb | 2 ++ app/controllers/vendor_controller.rb | 2 ++ app/helpers/market_helper.rb | 2 ++ app/helpers/product_helper.rb | 2 ++ app/helpers/sale_helper.rb | 2 ++ app/helpers/vendor_helper.rb | 2 ++ test/controllers/market_controller_test.rb | 7 +++++++ test/controllers/product_controller_test.rb | 7 +++++++ test/controllers/sale_controller_test.rb | 7 +++++++ test/controllers/vendor_controller_test.rb | 7 +++++++ 20 files changed, 68 insertions(+) create mode 100644 app/assets/javascripts/market.coffee create mode 100644 app/assets/javascripts/product.coffee create mode 100644 app/assets/javascripts/sale.coffee create mode 100644 app/assets/javascripts/vendor.coffee create mode 100644 app/assets/stylesheets/market.scss create mode 100644 app/assets/stylesheets/product.scss create mode 100644 app/assets/stylesheets/sale.scss create mode 100644 app/assets/stylesheets/vendor.scss create mode 100644 app/controllers/market_controller.rb create mode 100644 app/controllers/product_controller.rb create mode 100644 app/controllers/sale_controller.rb create mode 100644 app/controllers/vendor_controller.rb create mode 100644 app/helpers/market_helper.rb create mode 100644 app/helpers/product_helper.rb create mode 100644 app/helpers/sale_helper.rb create mode 100644 app/helpers/vendor_helper.rb create mode 100644 test/controllers/market_controller_test.rb create mode 100644 test/controllers/product_controller_test.rb create mode 100644 test/controllers/sale_controller_test.rb create mode 100644 test/controllers/vendor_controller_test.rb diff --git a/app/assets/javascripts/market.coffee b/app/assets/javascripts/market.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/market.coffee @@ -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/ diff --git a/app/assets/javascripts/product.coffee b/app/assets/javascripts/product.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/product.coffee @@ -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/ diff --git a/app/assets/javascripts/sale.coffee b/app/assets/javascripts/sale.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/sale.coffee @@ -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/ diff --git a/app/assets/javascripts/vendor.coffee b/app/assets/javascripts/vendor.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/vendor.coffee @@ -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/ diff --git a/app/assets/stylesheets/market.scss b/app/assets/stylesheets/market.scss new file mode 100644 index 00000000..d427bd0d --- /dev/null +++ b/app/assets/stylesheets/market.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the market controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/product.scss b/app/assets/stylesheets/product.scss new file mode 100644 index 00000000..3c4e9545 --- /dev/null +++ b/app/assets/stylesheets/product.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the product controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/sale.scss b/app/assets/stylesheets/sale.scss new file mode 100644 index 00000000..ed3b33f7 --- /dev/null +++ b/app/assets/stylesheets/sale.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the sale controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/vendor.scss b/app/assets/stylesheets/vendor.scss new file mode 100644 index 00000000..e0a50da6 --- /dev/null +++ b/app/assets/stylesheets/vendor.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the vendor controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb new file mode 100644 index 00000000..4a4bd8a3 --- /dev/null +++ b/app/controllers/market_controller.rb @@ -0,0 +1,2 @@ +class MarketController < ApplicationController +end diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb new file mode 100644 index 00000000..285b4b30 --- /dev/null +++ b/app/controllers/product_controller.rb @@ -0,0 +1,2 @@ +class ProductController < ApplicationController +end diff --git a/app/controllers/sale_controller.rb b/app/controllers/sale_controller.rb new file mode 100644 index 00000000..61a8c6d4 --- /dev/null +++ b/app/controllers/sale_controller.rb @@ -0,0 +1,2 @@ +class SaleController < ApplicationController +end diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb new file mode 100644 index 00000000..1a3701e9 --- /dev/null +++ b/app/controllers/vendor_controller.rb @@ -0,0 +1,2 @@ +class VendorController < ApplicationController +end diff --git a/app/helpers/market_helper.rb b/app/helpers/market_helper.rb new file mode 100644 index 00000000..afcf4e07 --- /dev/null +++ b/app/helpers/market_helper.rb @@ -0,0 +1,2 @@ +module MarketHelper +end diff --git a/app/helpers/product_helper.rb b/app/helpers/product_helper.rb new file mode 100644 index 00000000..d5da5605 --- /dev/null +++ b/app/helpers/product_helper.rb @@ -0,0 +1,2 @@ +module ProductHelper +end diff --git a/app/helpers/sale_helper.rb b/app/helpers/sale_helper.rb new file mode 100644 index 00000000..0f1c4ed9 --- /dev/null +++ b/app/helpers/sale_helper.rb @@ -0,0 +1,2 @@ +module SaleHelper +end diff --git a/app/helpers/vendor_helper.rb b/app/helpers/vendor_helper.rb new file mode 100644 index 00000000..e3f597e0 --- /dev/null +++ b/app/helpers/vendor_helper.rb @@ -0,0 +1,2 @@ +module VendorHelper +end diff --git a/test/controllers/market_controller_test.rb b/test/controllers/market_controller_test.rb new file mode 100644 index 00000000..c7d2332f --- /dev/null +++ b/test/controllers/market_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MarketControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/product_controller_test.rb b/test/controllers/product_controller_test.rb new file mode 100644 index 00000000..cc3f473f --- /dev/null +++ b/test/controllers/product_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/sale_controller_test.rb b/test/controllers/sale_controller_test.rb new file mode 100644 index 00000000..4ba79389 --- /dev/null +++ b/test/controllers/sale_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SaleControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/vendor_controller_test.rb b/test/controllers/vendor_controller_test.rb new file mode 100644 index 00000000..40e26779 --- /dev/null +++ b/test/controllers/vendor_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class VendorControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end From dbaf9a7c48d07640c3e1fad5b3904f73f33a18c6 Mon Sep 17 00:00:00 2001 From: Yeni Date: Tue, 4 Oct 2016 14:41:49 -0700 Subject: [PATCH 05/43] Added empty methods to market, product, vendor, sale controllers. --- app/controllers/market_controller.rb | 28 +++++++++++++++++++++++++++ app/controllers/product_controller.rb | 10 ++++++++++ app/controllers/sale_controller.rb | 10 ++++++++++ app/controllers/vendor_controller.rb | 28 +++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index 4a4bd8a3..df258324 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -1,2 +1,30 @@ class MarketController < ApplicationController + def index + + end + + def create + + end + + def new + + end + + def edit + + end + + def show + + end + + def update + + end + + def destroy + + end + end diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index 285b4b30..bdc8e2ed 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -1,2 +1,12 @@ class ProductController < ApplicationController + def create + + end + + def new + end + + def edit + end + end diff --git a/app/controllers/sale_controller.rb b/app/controllers/sale_controller.rb index 61a8c6d4..98c1c05e 100644 --- a/app/controllers/sale_controller.rb +++ b/app/controllers/sale_controller.rb @@ -1,2 +1,12 @@ class SaleController < ApplicationController + + def create + end + + def new + end + + def edit + end + end diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb index 1a3701e9..03dcdae9 100644 --- a/app/controllers/vendor_controller.rb +++ b/app/controllers/vendor_controller.rb @@ -1,2 +1,30 @@ class VendorController < ApplicationController + + def index + + end + + def create + + end + + def new + + end + + def edit + + end + + def show + + end + + def update + + end + + def destroy + + end end From 8247ea5c2e588a7b6cd7146e99e279d265ddc81f Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Tue, 4 Oct 2016 16:57:28 -0700 Subject: [PATCH 06/43] Set up and migrated seed data, added headers to .csvs, forced primary keys from .csv --- app/models/sale.rb | 3 ++- app/models/vendor.rb | 3 ++- db/migrate/20161004190501_create_markets.rb | 4 +++- db/migrate/20161004190547_create_vendors.rb | 5 +++-- db/migrate/20161004190612_create_products.rb | 5 +++-- db/migrate/20161004190718_create_sales.rb | 8 +++++--- db/seeds.rb | 19 +++++++++++++++++++ seed_csvs/markets.csv | 1 + seed_csvs/products.csv | 1 + seed_csvs/sales.csv | 1 + seed_csvs/vendors.csv | 1 + 11 files changed, 41 insertions(+), 10 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 27888ff7..613c86b2 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -1,3 +1,4 @@ class Sale < ActiveRecord::Base - belongs_to :product, :vendor + belongs_to :product + belongs_to :vendor end diff --git a/app/models/vendor.rb b/app/models/vendor.rb index ce34099d..fd5a3471 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -1,4 +1,5 @@ class Vendor < ActiveRecord::Base belongs_to :market - has_many :products, :sales + has_many :products + has_many :sales end diff --git a/db/migrate/20161004190501_create_markets.rb b/db/migrate/20161004190501_create_markets.rb index 8155ce25..53e43ae5 100644 --- a/db/migrate/20161004190501_create_markets.rb +++ b/db/migrate/20161004190501_create_markets.rb @@ -1,6 +1,8 @@ class CreateMarkets < ActiveRecord::Migration def change - create_table :markets do |t| + create_table :markets, id: false do |t| + + t.primary_key :id t.string :name t.string :address t.string :city diff --git a/db/migrate/20161004190547_create_vendors.rb b/db/migrate/20161004190547_create_vendors.rb index 67dd8020..9d5147dd 100644 --- a/db/migrate/20161004190547_create_vendors.rb +++ b/db/migrate/20161004190547_create_vendors.rb @@ -1,8 +1,9 @@ class CreateVendors < ActiveRecord::Migration def change - create_table :vendors do |t| + create_table :vendors, id: false do |t| t.belongs_to :market - + + t.primary_key :id t.string :name t.integer :num_employees t.integer :market_id diff --git a/db/migrate/20161004190612_create_products.rb b/db/migrate/20161004190612_create_products.rb index 79a5a3ac..3ac9d572 100644 --- a/db/migrate/20161004190612_create_products.rb +++ b/db/migrate/20161004190612_create_products.rb @@ -1,8 +1,9 @@ class CreateProducts < ActiveRecord::Migration def change - create_table :products do |t| + create_table :products, id: false do |t| t.belongs_to :vendor - + + t.primary_key :id t.string :name t.integer :vendor_id diff --git a/db/migrate/20161004190718_create_sales.rb b/db/migrate/20161004190718_create_sales.rb index 1f75190c..19aecec2 100644 --- a/db/migrate/20161004190718_create_sales.rb +++ b/db/migrate/20161004190718_create_sales.rb @@ -1,8 +1,10 @@ class CreateSales < ActiveRecord::Migration def change - create_table :sales do |t| - t.belongs_to :product, :vendor - + create_table :sales, id: false do |t| + t.belongs_to :product + t.belongs_to :vendor + + t.primary_key :id t.integer :amount t.datetime :purchase_time t.integer :vendor_id diff --git a/db/seeds.rb b/db/seeds.rb index 4edb1e85..03600596 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,22 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +require 'csv' + + +CSV.foreach('./seed_csvs/markets.csv', :headers => true) do |market| + Market.create(market.to_hash) +end + +CSV.foreach('./seed_csvs/vendors.csv', :headers => true) do |vendor| + Vendor.create(vendor.to_hash) +end + +CSV.foreach('./seed_csvs/products.csv', :headers => true) do |product| + Product.create(product.to_hash) +end + +CSV.foreach('./seed_csvs/sales.csv', :headers => true) do |sale| + Sale.create(sale.to_hash) +end diff --git a/seed_csvs/markets.csv b/seed_csvs/markets.csv index 9860f59f..b70dea63 100644 --- a/seed_csvs/markets.csv +++ b/seed_csvs/markets.csv @@ -1,3 +1,4 @@ +id,name,address,city,county,state,zip 1,"People's Co-op Farmers Market","30th and Burnside",Portland,Multnomah,Oregon,97202 2,"Silverdale Farmers Market",98383,Silverdale,Kitsap,Washington,98383 3,"Dolgeville Farmer's Market","(Parking Lot) Between Main St. and Helmer Ave",Dolgeville,Herkimer,"New York",13329 diff --git a/seed_csvs/products.csv b/seed_csvs/products.csv index ac508548..2f686605 100644 --- a/seed_csvs/products.csv +++ b/seed_csvs/products.csv @@ -1,3 +1,4 @@ +id,name,vendor_id 1,"Dry Beets",1 2,"Fierce Greens",2 3,"Heavy Chicken",2 diff --git a/seed_csvs/sales.csv b/seed_csvs/sales.csv index 67cfa4be..82ce2165 100644 --- a/seed_csvs/sales.csv +++ b/seed_csvs/sales.csv @@ -1,3 +1,4 @@ +id,amount,purchase_time,vendor_id,product_id 1,9290,"2013-11-07 12:34:56.000000",1,1 2,2262,"2013-11-10 10:44:56.000000",1,1 3,9588,"2013-11-13 09:49:37.000000",1,1 diff --git a/seed_csvs/vendors.csv b/seed_csvs/vendors.csv index a2bec328..242cd837 100644 --- a/seed_csvs/vendors.csv +++ b/seed_csvs/vendors.csv @@ -1,3 +1,4 @@ +id,name,num_employees,market_id 1,Feil-Farrell,8,1 2,"Hamill, Kilback and Pfeffer",5,1 3,"Breitenberg Inc",5,1 From 2e6f74bdaecced621016daf5ed1e055c525fbac6 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 10:54:17 -0700 Subject: [PATCH 07/43] Added rails-erd gem and generated a diagram --- Gemfile | 3 +++ Gemfile.lock | 10 ++++++++++ erd.pdf | Bin 0 -> 24803 bytes 3 files changed, 13 insertions(+) create mode 100644 erd.pdf diff --git a/Gemfile b/Gemfile index f1d0fa33..57bb3033 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc +gem 'graphviz' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' @@ -46,4 +47,6 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' + gem 'rails-erd' + gem 'graphviz' end diff --git a/Gemfile.lock b/Gemfile.lock index 6a4ecae9..168844f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,6 +45,7 @@ GEM debug_inspector (>= 0.0.1) builder (3.2.2) byebug (9.0.6) + choice (0.2.0) coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) @@ -59,6 +60,7 @@ GEM execjs (2.7.0) globalid (0.3.7) activesupport (>= 4.1.0) + graphviz (0.3.0) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -109,6 +111,11 @@ GEM activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) + rails-erd (1.5.0) + activerecord (>= 3.2) + activesupport (>= 3.2) + choice (~> 0.2.0) + ruby-graphviz (~> 1.2) rails-html-sanitizer (1.0.3) loofah (~> 2.0) railties (4.2.7) @@ -119,6 +126,7 @@ GEM rake (11.3.0) rdoc (4.2.2) json (~> 1.4) + ruby-graphviz (1.2.2) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -164,10 +172,12 @@ DEPENDENCIES binding_of_caller byebug coffee-rails (~> 4.1.0) + graphviz jbuilder (~> 2.0) jquery-rails pry-rails rails (= 4.2.7) + rails-erd sass-rails (~> 5.0) sdoc (~> 0.4.0) spring diff --git a/erd.pdf b/erd.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b9be1896691e63fb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qw%Ei!cZM>~9?DyX}YGaJ3800&KgT(^+H=_3U*um9B_7|Y` zHz*1-NzK*f*O>6%y4IA|(9x`~*SJf2@lj7%1}hYZC;6A%E9E zV3-J|pnu631Qz*K!@p}7y4K$`A>cpO8B-(h|F>3N9+-Bv_4xhb03C+_Odnv($l9*1 z7^2&+7Q{4!l8c=y2JiN-&$1Z6o4B2w4agb@v%ypr48!!L9as Date: Wed, 5 Oct 2016 12:16:08 -0700 Subject: [PATCH 08/43] Rough outputted list of all markets completed on market/index.html.erb --- Gemfile | 1 - app/controllers/market_controller.rb | 4 ++-- app/helpers/market_helper.rb | 1 + app/views/market/index.html.erb | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 app/views/market/index.html.erb diff --git a/Gemfile b/Gemfile index 57bb3033..8691526c 100644 --- a/Gemfile +++ b/Gemfile @@ -48,5 +48,4 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'rails-erd' - gem 'graphviz' end diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index df258324..21276606 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -1,6 +1,6 @@ class MarketController < ApplicationController def index - + @markets = Market.all end def create @@ -26,5 +26,5 @@ def update def destroy end - + end diff --git a/app/helpers/market_helper.rb b/app/helpers/market_helper.rb index afcf4e07..c9783721 100644 --- a/app/helpers/market_helper.rb +++ b/app/helpers/market_helper.rb @@ -1,2 +1,3 @@ module MarketHelper + end diff --git a/app/views/market/index.html.erb b/app/views/market/index.html.erb new file mode 100644 index 00000000..1f1d8c6e --- /dev/null +++ b/app/views/market/index.html.erb @@ -0,0 +1,6 @@ +

View all markets

+
    + <% @markets.each do |market| %> +
  • <%= market.name %>: <%= market.city %>, <%= market.state %>
  • + <% end %> +
From 83f011bd091c61875552d8e4fa3ed8c0e016dc39 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 14:01:36 -0700 Subject: [PATCH 09/43] Market index page laid out in a table with actions on individual markets --- app/controllers/market_controller.rb | 16 ++++++++++++---- app/views/market/destroy.html.erb | 0 app/views/market/edit.html.erb | 0 app/views/market/index.html.erb | 23 ++++++++++++++++++----- app/views/market/new.html.erb | 0 app/views/market/show.html.erb | 0 6 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 app/views/market/destroy.html.erb create mode 100644 app/views/market/edit.html.erb create mode 100644 app/views/market/new.html.erb create mode 100644 app/views/market/show.html.erb diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index 21276606..cbcb68c5 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -4,27 +4,35 @@ def index end def create + @market = Market.create(market_params) + redirect_to root_path end def new - + @market = Market.new end def edit - + @market = Market.find(params[:id]) end def show - + @market = Market.find(params[:id]) end def update + @market = Market.find(params[:id]) + if @market.update(market_params) + redirect_to market_path + else + render :edit + end end def destroy - + @market = Market.find(params[:id]).destroy end end diff --git a/app/views/market/destroy.html.erb b/app/views/market/destroy.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/market/edit.html.erb b/app/views/market/edit.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/market/index.html.erb b/app/views/market/index.html.erb index 1f1d8c6e..de758d03 100644 --- a/app/views/market/index.html.erb +++ b/app/views/market/index.html.erb @@ -1,6 +1,19 @@

View all markets

-
    - <% @markets.each do |market| %> -
  • <%= market.name %>: <%= market.city %>, <%= market.state %>
  • - <% end %> -
+ + + + + + + + <% @markets.each do |market| %> + + + + + + + <% end %> +
Market NameCityStateActions
<%= market.name %><%= market.city %><%= market.state %><%= link_to "[Details]", market_path(market) %> + <%= link_to "[Edit]", edit_market_path(market) %> + <%= link_to "[Delete]", market_path(market), method: :delete, data: { confirm: "Really, now?" } %>
diff --git a/app/views/market/new.html.erb b/app/views/market/new.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/market/show.html.erb b/app/views/market/show.html.erb new file mode 100644 index 00000000..e69de29b From eb09351f6bf29df9f66a8835376ddb31826022b8 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 14:29:58 -0700 Subject: [PATCH 10/43] Created market_form partial and added it to market/new and market/edit --- app/views/market/_market_form.html.erb | 47 ++++++++++++++++++++++++++ app/views/market/edit.html.erb | 3 ++ app/views/market/new.html.erb | 3 ++ 3 files changed, 53 insertions(+) create mode 100644 app/views/market/_market_form.html.erb diff --git a/app/views/market/_market_form.html.erb b/app/views/market/_market_form.html.erb new file mode 100644 index 00000000..f06e7f94 --- /dev/null +++ b/app/views/market/_market_form.html.erb @@ -0,0 +1,47 @@ +<% if @market.errors.any? %> +
    + <% @market.errors.each do |error, message| %> +
  • <%= error.upcase %><%= message %>
  • + <% end %> +
+<% end %> + + +<%= form_for @market, :url => market_index_path, method: http_method do |f| %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :address %> <%= f.text_field :address, :size => 100 %>
<%= f.label :city %><%= f.text_field :city %>
<%= f.label :county %><%= f.text_field :county, :size => 50 %>
<%= f.label :state %><%= f.text_field :state %>
<%= f.label :zip %><%= f.text_field :zip %>
<%= f.submit "Mark it, Market!" %>
+ +<% end %> diff --git a/app/views/market/edit.html.erb b/app/views/market/edit.html.erb index e69de29b..ffb9c9ac 100644 --- a/app/views/market/edit.html.erb +++ b/app/views/market/edit.html.erb @@ -0,0 +1,3 @@ +

Add new market!

+ +<%= render partial: "market_form", locals: {http_method: :patch} %> diff --git a/app/views/market/new.html.erb b/app/views/market/new.html.erb index e69de29b..a2ca15a2 100644 --- a/app/views/market/new.html.erb +++ b/app/views/market/new.html.erb @@ -0,0 +1,3 @@ +

Add new market!

+ +<%= render partial: "market_form", locals: {http_method: :post} %> From 07ddfe6c5756866bfc6ec2fe7d648f0f80395de7 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 14:41:42 -0700 Subject: [PATCH 11/43] Built skeleton of market/show page with full functionality --- app/views/market/index.html.erb | 2 +- app/views/market/show.html.erb | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/views/market/index.html.erb b/app/views/market/index.html.erb index de758d03..eb6e3508 100644 --- a/app/views/market/index.html.erb +++ b/app/views/market/index.html.erb @@ -13,7 +13,7 @@ <%= market.state %> <%= link_to "[Details]", market_path(market) %> <%= link_to "[Edit]", edit_market_path(market) %> - <%= link_to "[Delete]", market_path(market), method: :delete, data: { confirm: "Really, now?" } %> + <%= link_to "[Delete]", market_path(market), method: :delete, data: { confirm: "Really, now?" } %> <% end %> diff --git a/app/views/market/show.html.erb b/app/views/market/show.html.erb index e69de29b..8f40d0bf 100644 --- a/app/views/market/show.html.erb +++ b/app/views/market/show.html.erb @@ -0,0 +1,25 @@ +

--Detailed Market Page--

+ + + + + + + + + + + + + + + + + + +
NameAddressCityCountyStateZip
<%= @market.name %><%= @market.address %><%= @market.city %><%= @market.county %><%= @market.state %><%= @market.zip %>
+ +

<%= link_to "Back to all markets", market_index_path %>

+ +
+<%= button_to "Delete this market", {:action => 'destroy', :id => @market.id }, :method => :delete, data: { confirm: "Really, now?" } %> From f9af1578cda4696b8502aefb43da6850c015633f Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 14:48:55 -0700 Subject: [PATCH 12/43] Changed all view headers in market as

s --- app/views/market/destroy.html.erb | 3 +++ app/views/market/edit.html.erb | 2 +- app/views/market/index.html.erb | 2 +- app/views/market/new.html.erb | 2 +- app/views/market/show.html.erb | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/market/destroy.html.erb b/app/views/market/destroy.html.erb index e69de29b..9a7a9070 100644 --- a/app/views/market/destroy.html.erb +++ b/app/views/market/destroy.html.erb @@ -0,0 +1,3 @@ +

Market Deletion Confirmation

+ +<%= "Market \"#{@market.name}\" has been deleted." %> diff --git a/app/views/market/edit.html.erb b/app/views/market/edit.html.erb index ffb9c9ac..7c74eb53 100644 --- a/app/views/market/edit.html.erb +++ b/app/views/market/edit.html.erb @@ -1,3 +1,3 @@ -

Add new market!

+

Edit this market

<%= render partial: "market_form", locals: {http_method: :patch} %> diff --git a/app/views/market/index.html.erb b/app/views/market/index.html.erb index eb6e3508..2aa757be 100644 --- a/app/views/market/index.html.erb +++ b/app/views/market/index.html.erb @@ -1,4 +1,4 @@ -

View all markets

+

View all markets

diff --git a/app/views/market/new.html.erb b/app/views/market/new.html.erb index a2ca15a2..557af359 100644 --- a/app/views/market/new.html.erb +++ b/app/views/market/new.html.erb @@ -1,3 +1,3 @@ -

Add new market!

+

Add new market!

<%= render partial: "market_form", locals: {http_method: :post} %> diff --git a/app/views/market/show.html.erb b/app/views/market/show.html.erb index 8f40d0bf..6ba382c4 100644 --- a/app/views/market/show.html.erb +++ b/app/views/market/show.html.erb @@ -1,4 +1,4 @@ -

--Detailed Market Page--

+

Detailed Market Page

Market Name
From 9c94d688392f9d2981dace8b1647ded4d8c8ce89 Mon Sep 17 00:00:00 2001 From: Yeni Date: Wed, 5 Oct 2016 14:50:34 -0700 Subject: [PATCH 13/43] created homepage and its css stylesheet as well as application.html.erb and its css file. Haven't added links to 'act as ..' yet. --- Gemfile | 1 - app/assets/stylesheets/application.css | 68 +++++++++++++++++++++++ app/assets/stylesheets/homepage.scss | 0 app/controllers/application_controller.rb | 4 ++ app/controllers/homepage_controller.rb | 4 ++ app/views/homepage/index.html.erb | 24 ++++++++ app/views/layouts/application.html.erb | 7 +++ app/views/vendor/index.html.erb | 19 +++++++ config/routes.rb | 1 + 9 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/homepage.scss create mode 100644 app/controllers/homepage_controller.rb create mode 100644 app/views/homepage/index.html.erb create mode 100644 app/views/vendor/index.html.erb diff --git a/Gemfile b/Gemfile index 57bb3033..8691526c 100644 --- a/Gemfile +++ b/Gemfile @@ -48,5 +48,4 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'rails-erd' - gem 'graphviz' end diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b34..7f3d5aaa 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,3 +1,71 @@ +a:hover { + color: #9ADEF5; +} + +a { + color: #F5B19A; +} + +footer a { + color: #F5B19A; +} + +.top-buttons li { + display: inline; + font-family: 'Julius Sans One', sans-serif; + border-right: 2pt solid #39324b; + color: #39324b; + margin-right: 8%; + margin-left: 8%; + padding: 0 25px; + font-size: 9pt; +} + +footer { + font-family: 'Bad Script', sans-serif; + color: #F5B19A; + right: 0; + bottom: 0; + left: 0; + background-color: #efefef; + text-align: center; +} + +.bottom-buttons li{ + display: inline; + font-family: 'Julius Sans One', sans-serif; + border-right: 2pt solid #39324b; + color: #39324b; + margin-right: 8%; + margin-left: 8%; + padding: 0px 25px; + font-size: 9pt; +} + + +h1{ + text-align: center; + font-family: 'Poiret One', serif; + font-size: 4em; + color: #E3E7E8; + /*margin: 5%;*/ + +} + +h3 { + text-align: center; + font-family: 'Quicksand', serif; + letter-spacing: 5px; + font-size: 5em; + color: white; + border-radius: 25px; + background-size: 280px 260px; + padding: 3% 3%; + margin: 5% 10%; + background-repeat: repeat; + opacity: 0.7; + background-image: url("http://abwatercolors.com/wp-content/uploads/2012/11/farmersMarket.jpg"); +} /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. diff --git a/app/assets/stylesheets/homepage.scss b/app/assets/stylesheets/homepage.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e1..4d775767 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,8 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + def index + + end end diff --git a/app/controllers/homepage_controller.rb b/app/controllers/homepage_controller.rb new file mode 100644 index 00000000..e09cc6e5 --- /dev/null +++ b/app/controllers/homepage_controller.rb @@ -0,0 +1,4 @@ +class HomepageController < ApplicationController + def index + end +end diff --git a/app/views/homepage/index.html.erb b/app/views/homepage/index.html.erb new file mode 100644 index 00000000..a5db18af --- /dev/null +++ b/app/views/homepage/index.html.erb @@ -0,0 +1,24 @@ + + + + + + + + +
+

Welcome to FarMar Database!

+ +
+
+

ACT AS A MARKET

+

ACT AS A VENDOR

+
+ + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 443f3152..336a4f1f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,10 +5,17 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> + + <%= yield %> +
+

+ Brought to you by lovely Nicole and Yeni :) +

+
diff --git a/app/views/vendor/index.html.erb b/app/views/vendor/index.html.erb new file mode 100644 index 00000000..07444ac7 --- /dev/null +++ b/app/views/vendor/index.html.erb @@ -0,0 +1,19 @@ + + + + + + + +
+

View All Vendors

+ +
+ + diff --git a/config/routes.rb b/config/routes.rb index b2cb8105..78a2422d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ Rails.application.routes.draw do + root 'homepage#index' # Acting as a market resources :market do resources :vendor, only: [:new, :create, :edit, :delete] do From 2be1daf20ec48c36d40db2f79b882544b8fb14e2 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Wed, 5 Oct 2016 15:39:33 -0700 Subject: [PATCH 14/43] Added all standard views for vendor-related stuff. --- app/controllers/vendor_controller.rb | 19 +++++++++---- app/views/vendor/_vendor_form.html.erb | 32 ++++++++++++++++++++++ app/views/vendor/destroy.html.erb | 3 ++ app/views/vendor/edit.html.erb | 3 ++ app/views/vendor/index.html.erb | 38 +++++++++++++------------- app/views/vendor/new.html.erb | 3 ++ app/views/vendor/show.html.erb | 25 +++++++++++++++++ 7 files changed, 99 insertions(+), 24 deletions(-) create mode 100644 app/views/vendor/_vendor_form.html.erb create mode 100644 app/views/vendor/destroy.html.erb create mode 100644 app/views/vendor/edit.html.erb create mode 100644 app/views/vendor/new.html.erb create mode 100644 app/views/vendor/show.html.erb diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb index 03dcdae9..bca95682 100644 --- a/app/controllers/vendor_controller.rb +++ b/app/controllers/vendor_controller.rb @@ -1,30 +1,39 @@ class VendorController < ApplicationController def index - + @vendors = Vendor.all end def create + @vendor = Vendor.create(vendor_params) + redirect_to root_path end def new - + @vendor = Vendor.new end def edit - + @vendor = Vendor.find(params[:id]) end def show - + @vendor = Vendor.find(params[:id]) end def update + @vendor = Vendor.find(params[:id]) + if @vendor.update(vendor_params) + redirect_to vendor_path + else + render :edit + end end def destroy - + @vendor = Vendor.find(params[:id]).destroy end + end diff --git a/app/views/vendor/_vendor_form.html.erb b/app/views/vendor/_vendor_form.html.erb new file mode 100644 index 00000000..68c9f35c --- /dev/null +++ b/app/views/vendor/_vendor_form.html.erb @@ -0,0 +1,32 @@ +<% if @vendor.errors.any? %> +
    + <% @vendor.errors.each do |error, message| %> +
  • <%= error.upcase %><%= message %>
  • + <% end %> +
+<% end %> + +
+<%= form_for @vendor, :url => vendor_index_path, method: http_method do |f| %> + + + + + + + + + + + + + + + + + + + +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :num_employees %> <%= f.text_field :num_employees, :size => 100 %>
<%= f.label :market_id %><%= f.text_field :market_id %>
<%= f.submit "Send 'er, Vendor!" %>
+ +<% end %> diff --git a/app/views/vendor/destroy.html.erb b/app/views/vendor/destroy.html.erb new file mode 100644 index 00000000..f2a21f78 --- /dev/null +++ b/app/views/vendor/destroy.html.erb @@ -0,0 +1,3 @@ +

Vendor Deletion Confirmation

+ +<%= "Vendor \"#{@vendor.name}\" has been deleted." %> diff --git a/app/views/vendor/edit.html.erb b/app/views/vendor/edit.html.erb new file mode 100644 index 00000000..a0287013 --- /dev/null +++ b/app/views/vendor/edit.html.erb @@ -0,0 +1,3 @@ +

Edit this vendor

+ +<%= render partial: "vendor_form", locals: {http_method: :patch} %> diff --git a/app/views/vendor/index.html.erb b/app/views/vendor/index.html.erb index 07444ac7..f1a8104d 100644 --- a/app/views/vendor/index.html.erb +++ b/app/views/vendor/index.html.erb @@ -1,19 +1,19 @@ - - - - - - - -
-

View All Vendors

- -
- - +

View all vendors

+ + + + + + + + <% @vendors.each do |vendor| %> + + + + + + + <% end %> +
Vendor Name# of EmployeesMarketActions
<%= link_to "#{vendor.name}", vendor_path(vendor) %><%= vendor.num_employees %><%= Market.find(vendor.market_id).name %> + <%= link_to "[Edit]", edit_vendor_path(vendor) %> + <%= link_to "[Delete]", vendor_path(vendor), method: :delete, data: { confirm: "Really, now?" } %>
diff --git a/app/views/vendor/new.html.erb b/app/views/vendor/new.html.erb new file mode 100644 index 00000000..557af359 --- /dev/null +++ b/app/views/vendor/new.html.erb @@ -0,0 +1,3 @@ +

Add new market!

+ +<%= render partial: "market_form", locals: {http_method: :post} %> diff --git a/app/views/vendor/show.html.erb b/app/views/vendor/show.html.erb new file mode 100644 index 00000000..6ba382c4 --- /dev/null +++ b/app/views/vendor/show.html.erb @@ -0,0 +1,25 @@ +

Detailed Market Page

+ + + + + + + + + + + + + + + + + + +
NameAddressCityCountyStateZip
<%= @market.name %><%= @market.address %><%= @market.city %><%= @market.county %><%= @market.state %><%= @market.zip %>
+ +

<%= link_to "Back to all markets", market_index_path %>

+ +
+<%= button_to "Delete this market", {:action => 'destroy', :id => @market.id }, :method => :delete, data: { confirm: "Really, now?" } %> From 503be4e6de5e51054d119e1344a00fc2e9d91a93 Mon Sep 17 00:00:00 2001 From: Yeni Date: Wed, 5 Oct 2016 15:50:59 -0700 Subject: [PATCH 15/43] created stylesheet for market home and market show. --- app/assets/stylesheets/application.css | 20 ++++++++++++++++++++ app/controllers/market_controller.rb | 7 +++++++ app/views/market/index.html.erb | 4 ++-- app/views/market/show.html.erb | 15 ++++++++------- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 7f3d5aaa..e200d26c 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -4,6 +4,7 @@ a:hover { a { color: #F5B19A; + font-family: 'Quicksand'; } footer a { @@ -66,6 +67,25 @@ h3 { opacity: 0.7; background-image: url("http://abwatercolors.com/wp-content/uploads/2012/11/farmersMarket.jpg"); } + +table { + margin: 0 17%; + font-family: 'Quicksand', sans-serif; + font-size: 14px; + line-height: 25px; +} +th { + text-align: left; +} + + +/*.table-top * { + margin: 0 20%; +} + +.table-info * { + margin-right: 10%; +}*/ /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index cbcb68c5..c6d37535 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -35,4 +35,11 @@ def destroy @market = Market.find(params[:id]).destroy end + #added this method for dealing with list of vendor from market + # def vendor_list + # @market = Market.find(params[:id]) + # @marker.vendor + # redirect_to market_vendor_index + # end + end diff --git a/app/views/market/index.html.erb b/app/views/market/index.html.erb index 2aa757be..94cdee00 100644 --- a/app/views/market/index.html.erb +++ b/app/views/market/index.html.erb @@ -8,10 +8,10 @@ <% @markets.each do |market| %> - <%= market.name %> + <%= link_to "#{market.name}", market_path(market) %> <%= market.city %> <%= market.state %> - <%= link_to "[Details]", market_path(market) %> + <%= link_to "[Edit]", edit_market_path(market) %> <%= link_to "[Delete]", market_path(market), method: :delete, data: { confirm: "Really, now?" } %> diff --git a/app/views/market/show.html.erb b/app/views/market/show.html.erb index 6ba382c4..2afcd51b 100644 --- a/app/views/market/show.html.erb +++ b/app/views/market/show.html.erb @@ -1,6 +1,6 @@

Detailed Market Page

- +
@@ -10,16 +10,17 @@ - - - - - - + + + + + +
Name AddressZip
<%= @market.name %><%= @market.address %><%= @market.city %><%= @market.county %><%= @market.state %><%= @market.zip %><%= @market.name %><%= @market.address %><%= @market.city %><%= @market.county %><%= @market.state %><%= @market.zip %>

<%= link_to "Back to all markets", market_index_path %>

+

<%= link_to "View all vendors", market_index_path %>


<%= button_to "Delete this market", {:action => 'destroy', :id => @market.id }, :method => :delete, data: { confirm: "Really, now?" } %> From eb7bee8e00e296bfb9c6d7098b11fc681d53d53e Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 13:46:24 -0700 Subject: [PATCH 16/43] Created Vendor/Products index page, partial products_forms and views. Links not tested. --- app/controllers/product_controller.rb | 19 +++++++++++++++- app/views/product/_product_form.html.erb | 28 ++++++++++++++++++++++++ app/views/product/destroy.html.erb | 3 +++ app/views/product/edit.html.erb | 3 +++ app/views/product/index.html.erb | 19 ++++++++++++++++ app/views/product/new.html.erb | 3 +++ app/views/product/show.html.erb | 19 ++++++++++++++++ config/routes.rb | 10 ++------- 8 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 app/views/product/_product_form.html.erb create mode 100644 app/views/product/destroy.html.erb create mode 100644 app/views/product/edit.html.erb create mode 100644 app/views/product/index.html.erb create mode 100644 app/views/product/new.html.erb create mode 100644 app/views/product/show.html.erb diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index bdc8e2ed..4924117d 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -1,12 +1,29 @@ class ProductController < ApplicationController + def index + vendor = Vendor.find(params[:vendor_id]) + @products = Product.where(:vendor_id => vendor.id) + end + def create + @product = product.create(product_params) + redirect_to vendor_product_index_path end def new + @product = Product.new end def edit + @product = Product.find(params[:id]) + end + + def show + @product = Product.find(params[:id]) end - + + def destroy + @product = Product.find(params[:id]).destroy + end + end diff --git a/app/views/product/_product_form.html.erb b/app/views/product/_product_form.html.erb new file mode 100644 index 00000000..a611745d --- /dev/null +++ b/app/views/product/_product_form.html.erb @@ -0,0 +1,28 @@ +

Add new product for <%= Vendor.find(params[:vendor_id]).name %>

+ +<% if @product.errors.any? %> +
    + <% @product.errors.each do |error, message| %> +
  • <%= error.upcase %><%= message %>
  • + <% end %> +
+<% end %> + + + <%= form_for @product, :url => vendor_product_index_path, method: http_method do |f| %> + + + + + + + + + + + + + +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :vendor_id %> <%= f.text_field :vendor_id, :size => 100 %>
<%= f.submit "Produce Product!" %>
+ +<% end %> diff --git a/app/views/product/destroy.html.erb b/app/views/product/destroy.html.erb new file mode 100644 index 00000000..304851f4 --- /dev/null +++ b/app/views/product/destroy.html.erb @@ -0,0 +1,3 @@ +

Product Deletion Confirmation

+ +<%= "Product \"#{@product.name}\" has been deleted." %> diff --git a/app/views/product/edit.html.erb b/app/views/product/edit.html.erb new file mode 100644 index 00000000..571499ff --- /dev/null +++ b/app/views/product/edit.html.erb @@ -0,0 +1,3 @@ +

Edit this product

+ +<%= render partial: "product_form", locals: {http_method: :patch} %> diff --git a/app/views/product/index.html.erb b/app/views/product/index.html.erb new file mode 100644 index 00000000..cf091e5e --- /dev/null +++ b/app/views/product/index.html.erb @@ -0,0 +1,19 @@ +

<%= Vendor.find(@products[0].vendor_id).name %>'s Products

+

Market: <%= Market.find(@products[0].vendor_id).name %>

+ + + + + + + <% @products.each do |product| %> + + + + + <% end %> +
Product NameActions
<%= product.name %> + <%= link_to "[Edit]", edit_vendor_product_path(product) %> + <%= link_to "[Delete]", vendor_product_path_index(product), method: :delete, data: { confirm: "Really, now?" } %>
+ +

<%= link_to "Add a new product!", new_vendor_product_path %>

diff --git a/app/views/product/new.html.erb b/app/views/product/new.html.erb new file mode 100644 index 00000000..9a4717fe --- /dev/null +++ b/app/views/product/new.html.erb @@ -0,0 +1,3 @@ +

Add new product!

+ +<%= render partial: "product_form", locals: {http_method: :post} %> diff --git a/app/views/product/show.html.erb b/app/views/product/show.html.erb new file mode 100644 index 00000000..68668d02 --- /dev/null +++ b/app/views/product/show.html.erb @@ -0,0 +1,19 @@ +

Detailed Product Page

+ + + + + + + + + + +
NameProduct IDVendor ID
<%= @product.name %><%= @product.id %> + <%= @product.vendor_id %> +
+ +

<%= link_to "Back to all products", vendor_product_index_path %>

+ +
+<%= button_to "Delete this product", {:action => 'destroy', :id => @product.id }, :method => :delete, data: { confirm: "Really, now?" } %> diff --git a/config/routes.rb b/config/routes.rb index 78a2422d..5880729b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,19 +3,13 @@ root 'homepage#index' # Acting as a market resources :market do - resources :vendor, only: [:new, :create, :edit, :delete] do - # resources :product, :sale, only: [:new, :create, :edit, :delete] do - # resources :sale, only: [:new, :create, :edit, :delete] - # end - end + resources :vendor end # Acting as a Vendor resources :vendor do - resources :product, :sale, only: [:new, :create, :edit, :delete] do - resources :sale, only: [:new, :create, :edit, :delete] - end + resources :product, :sale end From d03c8d1095efaa43c102d737e2e3b31411896806 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 14:07:12 -0700 Subject: [PATCH 17/43] Sucessfully got destroy id from view all products by vendor index page. --- app/controllers/product_controller.rb | 3 ++- app/views/product/destroy.html.erb | 3 --- app/views/product/index.html.erb | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 app/views/product/destroy.html.erb diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index 4924117d..4f69c583 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -15,7 +15,7 @@ def new end def edit - @product = Product.find(params[:id]) + @product = Product.find(params[:vendor_id]) end def show @@ -24,6 +24,7 @@ def show def destroy @product = Product.find(params[:id]).destroy + redirect_to vendor_product_index_path end end diff --git a/app/views/product/destroy.html.erb b/app/views/product/destroy.html.erb deleted file mode 100644 index 304851f4..00000000 --- a/app/views/product/destroy.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

Product Deletion Confirmation

- -<%= "Product \"#{@product.name}\" has been deleted." %> diff --git a/app/views/product/index.html.erb b/app/views/product/index.html.erb index cf091e5e..da1edabf 100644 --- a/app/views/product/index.html.erb +++ b/app/views/product/index.html.erb @@ -10,8 +10,8 @@ <%= product.name %> - <%= link_to "[Edit]", edit_vendor_product_path(product) %> - <%= link_to "[Delete]", vendor_product_path_index(product), method: :delete, data: { confirm: "Really, now?" } %> + <%= link_to "[Edit]", edit_vendor_product_path(product.vendor_id, product) %> + <%= link_to "[Delete]", vendor_product_path(product.vendor_id, product.id), method: :delete, data: { confirm: "Really, now?" } %>
<% end %> From 9b77825c37a0ee764ec17652033f5c806534ca6b Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 14:10:42 -0700 Subject: [PATCH 18/43] Fixed problem on vendor/product/show page bc I was pointing to vendor_id instead of product_id for some random reason --- app/controllers/product_controller.rb | 2 +- app/views/product/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index 4f69c583..afa8ab3a 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -15,7 +15,7 @@ def new end def edit - @product = Product.find(params[:vendor_id]) + @product = Product.find(params[:id]) end def show diff --git a/app/views/product/index.html.erb b/app/views/product/index.html.erb index da1edabf..d6158e90 100644 --- a/app/views/product/index.html.erb +++ b/app/views/product/index.html.erb @@ -10,7 +10,7 @@ <%= product.name %> - <%= link_to "[Edit]", edit_vendor_product_path(product.vendor_id, product) %> + <%= link_to "[Edit]", edit_vendor_product_path(product.vendor_id, product.id) %> <%= link_to "[Delete]", vendor_product_path(product.vendor_id, product.id), method: :delete, data: { confirm: "Really, now?" } %> <% end %> From 4c4d4d1b9db3fddefdd196a1cc6ba12d783046eb Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 14:15:14 -0700 Subject: [PATCH 19/43] Tested deleting and adding products for a vendor successfully --- app/controllers/product_controller.rb | 11 ++++++++++- app/views/product/_product_form.html.erb | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index afa8ab3a..4df45e73 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -5,7 +5,7 @@ def index end def create - @product = product.create(product_params) + @product = Product.create(product_params) redirect_to vendor_product_index_path end @@ -27,4 +27,13 @@ def destroy redirect_to vendor_product_index_path end +####### STRONG PARAMS ####### + +private + +def product_params + params.require(:product).permit(:name, :vendor_id) + # params.require(:table_name).permit(:field_one, :field_two) +end + end diff --git a/app/views/product/_product_form.html.erb b/app/views/product/_product_form.html.erb index a611745d..026d23ab 100644 --- a/app/views/product/_product_form.html.erb +++ b/app/views/product/_product_form.html.erb @@ -9,7 +9,7 @@ <% end %> - <%= form_for @product, :url => vendor_product_index_path, method: http_method do |f| %> + <%= form_for @product, :url => vendor_product_index_path(params[:vendor_id]), method: http_method do |f| %> From 795f815058f2385ecfe8dccec02386fa6da090ef Mon Sep 17 00:00:00 2001 From: Yeni Date: Thu, 6 Oct 2016 14:56:25 -0700 Subject: [PATCH 20/43] worked on vendor pages layout, included nav bar in the application layout page to show on every page instead of putting it in every single page ever. --- app/assets/stylesheets/application.css | 49 ++++++++++++++++++++------ app/views/homepage/index.html.erb | 16 ++------- app/views/layouts/application.html.erb | 17 +++++++-- app/views/vendor/_vendor_form.html.erb | 3 ++ app/views/vendor/edit.html.erb | 4 ++- app/views/vendor/index.html.erb | 8 ++--- app/views/vendor/new.html.erb | 4 +-- app/views/vendor/show.html.erb | 32 +++++++++-------- 8 files changed, 85 insertions(+), 48 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e200d26c..1f6630a6 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,5 +1,5 @@ a:hover { - color: #9ADEF5; + color: #666699; } a { @@ -11,11 +11,28 @@ footer a { color: #F5B19A; } +h1 { + text-align: center; + font-family: 'Poiret One', serif; + font-size: 4em; + color: #C28599; + /*background-color: #efefef;*/ +} + +/*main { + margin-top: 30px; +}*/ + +nav{ +margin-left: 8%; +} + .top-buttons li { display: inline; font-family: 'Julius Sans One', sans-serif; - border-right: 2pt solid #39324b; - color: #39324b; + border-right: 2pt solid #F5B19A; + color: #666699; + /*previous color #39324b*/ margin-right: 8%; margin-left: 8%; padding: 0 25px; @@ -30,6 +47,7 @@ footer { left: 0; background-color: #efefef; text-align: center; + margin-top: 5%; } .bottom-buttons li{ @@ -44,16 +62,23 @@ footer { } -h1{ +h3 { text-align: center; - font-family: 'Poiret One', serif; - font-size: 4em; - color: #E3E7E8; - /*margin: 5%;*/ - + font-family: 'Quicksand', serif; + letter-spacing: 5px; + font-size: 5em; + color: white; + border-radius: 25px; + background-size: 280px 260px; + /*padding will add an empty h3 background to a page that has no h3 field*/ + /*padding: 3% 3%;*/ + margin: 5% 10%; + background-repeat: repeat; + opacity: 0.7; + background-image: url("http://abwatercolors.com/wp-content/uploads/2012/11/farmersMarket.jpg"); } -h3 { +h2 { text-align: center; font-family: 'Quicksand', serif; letter-spacing: 5px; @@ -78,6 +103,10 @@ th { text-align: left; } +main table { + margin-top: 6%; + margin-left: 35%; +} /*.table-top * { margin: 0 20%; diff --git a/app/views/homepage/index.html.erb b/app/views/homepage/index.html.erb index a5db18af..5126cdc9 100644 --- a/app/views/homepage/index.html.erb +++ b/app/views/homepage/index.html.erb @@ -2,23 +2,13 @@ - + <%= @title = 'Welcome to FarMar Database!'%> -
-

Welcome to FarMar Database!

- -
-

ACT AS A MARKET

-

ACT AS A VENDOR

+

ACT AS A MARKET

+

ACT AS A VENDOR

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 336a4f1f..6151211f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - FarMarRails + FarMar <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> @@ -9,8 +9,21 @@ +
+

<%= @title %>

+

<%= @page_name %>

+ +
+
+ <%= yield %> +
-<%= yield %>

diff --git a/app/views/vendor/_vendor_form.html.erb b/app/views/vendor/_vendor_form.html.erb index 68c9f35c..954d8ade 100644 --- a/app/views/vendor/_vendor_form.html.erb +++ b/app/views/vendor/_vendor_form.html.erb @@ -1,3 +1,6 @@ + + <%= @page_name = 'Vendor Form'%> + <% if @vendor.errors.any? %>

    <% @vendor.errors.each do |error, message| %> diff --git a/app/views/vendor/edit.html.erb b/app/views/vendor/edit.html.erb index a0287013..6fb916b8 100644 --- a/app/views/vendor/edit.html.erb +++ b/app/views/vendor/edit.html.erb @@ -1,3 +1,5 @@ -

    Edit this vendor

    + + <%= @page_name = 'Edit this Vendor'%> + <%= render partial: "vendor_form", locals: {http_method: :patch} %> diff --git a/app/views/vendor/index.html.erb b/app/views/vendor/index.html.erb index f1a8104d..80ffb1f5 100644 --- a/app/views/vendor/index.html.erb +++ b/app/views/vendor/index.html.erb @@ -1,16 +1,14 @@ -

    View all vendors

    + + <%= @page_name = 'View All Vendors'%> +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
- - <% @vendors.each do |vendor| %> - - diff --git a/app/views/vendor/new.html.erb b/app/views/vendor/new.html.erb index 557af359..77f06ed9 100644 --- a/app/views/vendor/new.html.erb +++ b/app/views/vendor/new.html.erb @@ -1,3 +1,3 @@ -

Add new market!

+

Add new vendor!

-<%= render partial: "market_form", locals: {http_method: :post} %> +<%= render partial: "vendor_form", locals: {http_method: :post} %> diff --git a/app/views/vendor/show.html.erb b/app/views/vendor/show.html.erb index 6ba382c4..306a9274 100644 --- a/app/views/vendor/show.html.erb +++ b/app/views/vendor/show.html.erb @@ -1,25 +1,27 @@ -

Detailed Market Page

+ + <%= @page_name = 'Detailed Vendor Page'%> + -
Vendor Name# of EmployeesMarket Actions
<%= link_to "#{vendor.name}", vendor_path(vendor) %><%= vendor.num_employees %><%= Market.find(vendor.market_id).name %> <%= link_to "[Edit]", edit_vendor_path(vendor) %> <%= link_to "[Delete]", vendor_path(vendor), method: :delete, data: { confirm: "Really, now?" } %>
+
+
- - - - - + + + - - - - - - + + + +
NameAddressCityCountyStateZipID# of EmployeesMarket
<%= @market.name %><%= @market.address %><%= @market.city %><%= @market.county %><%= @market.state %><%= @market.zip %><%= @vendor.name %><%= @vendor.id %><%= @vendor.num_employees %><%= Market.find(@vendor.market_id).name %>
-

<%= link_to "Back to all markets", market_index_path %>

+

<%= link_to "Back to all vendors", vendor_index_path %>

+ +

<%= link_to "View all products", vendor_product_index_path %>


-<%= button_to "Delete this market", {:action => 'destroy', :id => @market.id }, :method => :delete, data: { confirm: "Really, now?" } %> +<%= button_to "Delete this vendor", {:action => 'destroy', :id => @vendor.id }, :method => :delete, data: { confirm: "Really, now?" } %> + From 20cc48efc64c30d09d5ed131d00050707bdd12b5 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 15:01:35 -0700 Subject: [PATCH 21/43] Solved problem where you could only edit a product once. --- app/controllers/product_controller.rb | 11 ++++++++++- app/views/product/_product_form.html.erb | 6 ++---- app/views/product/edit.html.erb | 6 ++++-- app/views/product/new.html.erb | 6 ++++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index 4df45e73..d43a6f1d 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -6,7 +6,6 @@ def index def create @product = Product.create(product_params) - redirect_to vendor_product_index_path end @@ -18,6 +17,16 @@ def edit @product = Product.find(params[:id]) end + def update + @product = Product.find(params[:id]) + + if @product.update(product_params) + redirect_to vendor_product_index_path + else + render :edit + end + end + def show @product = Product.find(params[:id]) end diff --git a/app/views/product/_product_form.html.erb b/app/views/product/_product_form.html.erb index 026d23ab..6f4f2967 100644 --- a/app/views/product/_product_form.html.erb +++ b/app/views/product/_product_form.html.erb @@ -1,5 +1,3 @@ -

Add new product for <%= Vendor.find(params[:vendor_id]).name %>

- <% if @product.errors.any? %>
    <% @product.errors.each do |error, message| %> @@ -8,8 +6,9 @@
<% end %> + +<%= form_for @product, url: path, method: http_method do |f| %> - <%= form_for @product, :url => vendor_product_index_path(params[:vendor_id]), method: http_method do |f| %> @@ -24,5 +23,4 @@
<%= f.label :name %> <%= f.text_field :name, :size => 100 %> <%= f.submit "Produce Product!" %>
- <% end %> diff --git a/app/views/product/edit.html.erb b/app/views/product/edit.html.erb index 571499ff..666db5d4 100644 --- a/app/views/product/edit.html.erb +++ b/app/views/product/edit.html.erb @@ -1,3 +1,5 @@ -

Edit this product

+

<%= Vendor.find(params[:vendor_id]).name %>

-<%= render partial: "product_form", locals: {http_method: :patch} %> +

Edit product

+ +<%= render partial: "product_form", locals: {path: vendor_product_path, http_method: :patch} %> diff --git a/app/views/product/new.html.erb b/app/views/product/new.html.erb index 9a4717fe..e7f5b480 100644 --- a/app/views/product/new.html.erb +++ b/app/views/product/new.html.erb @@ -1,3 +1,5 @@ -

Add new product!

+

<%= Vendor.find(params[:vendor_id]).name %>

-<%= render partial: "product_form", locals: {http_method: :post} %> +

Add new product

+ +<%= render partial: "product_form", locals: {path: vendor_product_index_path, http_method: :post} %> From 982725d336c1e0a9cbc63a2d45be34873684c12d Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 15:05:00 -0700 Subject: [PATCH 22/43] Fixed all forms where the table begins inside the form code and not outside --- app/views/market/_market_form.html.erb | 70 +++++++++++++------------- app/views/vendor/_vendor_form.html.erb | 34 ++++++------- 2 files changed, 50 insertions(+), 54 deletions(-) diff --git a/app/views/market/_market_form.html.erb b/app/views/market/_market_form.html.erb index f06e7f94..87981d17 100644 --- a/app/views/market/_market_form.html.erb +++ b/app/views/market/_market_form.html.erb @@ -6,42 +6,40 @@ <% end %> - <%= form_for @market, :url => market_index_path, method: http_method do |f| %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :address %> <%= f.text_field :address, :size => 100 %>
<%= f.label :city %><%= f.text_field :city %>
<%= f.label :county %><%= f.text_field :county, :size => 50 %>
<%= f.label :state %><%= f.text_field :state %>
<%= f.label :zip %><%= f.text_field :zip %>
<%= f.submit "Mark it, Market!" %>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :address %> <%= f.text_field :address, :size => 100 %>
<%= f.label :city %><%= f.text_field :city %>
<%= f.label :county %><%= f.text_field :county, :size => 50 %>
<%= f.label :state %><%= f.text_field :state %>
<%= f.label :zip %><%= f.text_field :zip %>
<%= f.submit "Mark it, Market!" %>
- <% end %> diff --git a/app/views/vendor/_vendor_form.html.erb b/app/views/vendor/_vendor_form.html.erb index 954d8ade..a2654303 100644 --- a/app/views/vendor/_vendor_form.html.erb +++ b/app/views/vendor/_vendor_form.html.erb @@ -9,27 +9,25 @@ <% end %> - <%= form_for @vendor, :url => vendor_index_path, method: http_method do |f| %> - - - - - - - - - +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :num_employees %> <%= f.text_field :num_employees, :size => 100 %>
+ + + + - - - - + + + + - - - + + + + + + +
<%= f.label :name %> <%= f.text_field :name, :size => 100 %>
<%= f.label :market_id %><%= f.text_field :market_id %>
<%= f.label :num_employees %> <%= f.text_field :num_employees, :size => 100 %>
<%= f.submit "Send 'er, Vendor!" %>
<%= f.label :market_id %><%= f.text_field :market_id %>
<%= f.submit "Send 'er, Vendor!" %>
- <% end %> From 05b4d07ea74a99cd797f5b10d8cb295d966e6bc2 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 15:52:31 -0700 Subject: [PATCH 23/43] Added strong params in market, product, and vendor controllers --- app/controllers/market_controller.rb | 13 +++++++------ app/controllers/product_controller.rb | 11 +++++------ app/controllers/vendor_controller.rb | 8 ++++++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index c6d37535..fd70ed79 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -35,11 +35,12 @@ def destroy @market = Market.find(params[:id]).destroy end - #added this method for dealing with list of vendor from market - # def vendor_list - # @market = Market.find(params[:id]) - # @marker.vendor - # redirect_to market_vendor_index - # end +####### STRONG PARAMS ######### + + private + + def market_params + params.require(:market).permit(:name, :address, :city, :county, :state, :zip) + end end diff --git a/app/controllers/product_controller.rb b/app/controllers/product_controller.rb index d43a6f1d..7e809f57 100644 --- a/app/controllers/product_controller.rb +++ b/app/controllers/product_controller.rb @@ -36,13 +36,12 @@ def destroy redirect_to vendor_product_index_path end -####### STRONG PARAMS ####### +####### STRONG PARAMS ######### -private + private -def product_params - params.require(:product).permit(:name, :vendor_id) - # params.require(:table_name).permit(:field_one, :field_two) -end + def product_params + params.require(:product).permit(:name, :vendor_id) + end end diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb index bca95682..9de10401 100644 --- a/app/controllers/vendor_controller.rb +++ b/app/controllers/vendor_controller.rb @@ -36,4 +36,12 @@ def destroy @vendor = Vendor.find(params[:id]).destroy end + +####### STRONG PARAMS ######### + + private + + def vendor_params + params.require(:vendor).permit(:name, :num_employees, :market_id) + end end From 9c58a38b891e05ddf06572b960d7d01e9d9da0b8 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 16:12:05 -0700 Subject: [PATCH 24/43] Got markets to show its vendors. --- app/controllers/vendor_controller.rb | 7 ++++++- app/views/layouts/application.html.erb | 6 +++--- app/views/market/_market_form.html.erb | 2 +- app/views/market/edit.html.erb | 2 +- app/views/market/new.html.erb | 2 +- app/views/market/show.html.erb | 2 +- app/views/vendor/show.html.erb | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb index 9de10401..2c42cb7b 100644 --- a/app/controllers/vendor_controller.rb +++ b/app/controllers/vendor_controller.rb @@ -1,7 +1,12 @@ class VendorController < ApplicationController def index - @vendors = Vendor.all + if market = Market.find(params[:market_id]) + @vendors = market.vendors + return @vendors + else + @vendors = Vendor.all + end end def create diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6151211f..1a87a8ca 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,9 +14,9 @@

<%= @page_name %>

diff --git a/app/views/market/_market_form.html.erb b/app/views/market/_market_form.html.erb index 87981d17..71863a0b 100644 --- a/app/views/market/_market_form.html.erb +++ b/app/views/market/_market_form.html.erb @@ -6,7 +6,7 @@ <% end %> -<%= form_for @market, :url => market_index_path, method: http_method do |f| %> +<%= form_for @market, url: path, method: http_method do |f| %> diff --git a/app/views/market/edit.html.erb b/app/views/market/edit.html.erb index 7c74eb53..8c9ce0ab 100644 --- a/app/views/market/edit.html.erb +++ b/app/views/market/edit.html.erb @@ -1,3 +1,3 @@

Edit this market

-<%= render partial: "market_form", locals: {http_method: :patch} %> +<%= render partial: "market_form", locals: {path: market_path, http_method: :patch} %> diff --git a/app/views/market/new.html.erb b/app/views/market/new.html.erb index 557af359..7c561781 100644 --- a/app/views/market/new.html.erb +++ b/app/views/market/new.html.erb @@ -1,3 +1,3 @@

Add new market!

-<%= render partial: "market_form", locals: {http_method: :post} %> +<%= render partial: "market_form", locals: {path: market_index_path, http_method: :post} %> diff --git a/app/views/market/show.html.erb b/app/views/market/show.html.erb index 2afcd51b..c516fbd9 100644 --- a/app/views/market/show.html.erb +++ b/app/views/market/show.html.erb @@ -20,7 +20,7 @@
<%= f.label :name %>

<%= link_to "Back to all markets", market_index_path %>

-

<%= link_to "View all vendors", market_index_path %>

+

<%= link_to "View all vendors", market_vendor_index_path(params[:id]) %>


<%= button_to "Delete this market", {:action => 'destroy', :id => @market.id }, :method => :delete, data: { confirm: "Really, now?" } %> diff --git a/app/views/vendor/show.html.erb b/app/views/vendor/show.html.erb index 306a9274..c121b5ec 100644 --- a/app/views/vendor/show.html.erb +++ b/app/views/vendor/show.html.erb @@ -20,7 +20,7 @@

<%= link_to "Back to all vendors", vendor_index_path %>

-

<%= link_to "View all products", vendor_product_index_path %>

+

<%= link_to "View all products", vendor_product_index_path(params[:id]) %>


<%= button_to "Delete this vendor", {:action => 'destroy', :id => @vendor.id }, :method => :delete, data: { confirm: "Really, now?" } %> From ae70640eff4c5678d97f690957ad9ce935885bc3 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 16:46:14 -0700 Subject: [PATCH 25/43] Made the add new vendor link dependant on you being a market --- app/controllers/market_controller.rb | 2 ++ app/controllers/vendor_controller.rb | 6 ++++-- app/models/vendor.rb | 6 ++++++ app/views/market/destroy.html.erb | 3 --- app/views/vendor/destroy.html.erb | 3 --- app/views/vendor/index.html.erb | 5 +++++ 6 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 app/views/market/destroy.html.erb delete mode 100644 app/views/vendor/destroy.html.erb diff --git a/app/controllers/market_controller.rb b/app/controllers/market_controller.rb index fd70ed79..c1ae9d33 100644 --- a/app/controllers/market_controller.rb +++ b/app/controllers/market_controller.rb @@ -33,6 +33,8 @@ def update def destroy @market = Market.find(params[:id]).destroy + + redirect_to market_index_path end ####### STRONG PARAMS ######### diff --git a/app/controllers/vendor_controller.rb b/app/controllers/vendor_controller.rb index 2c42cb7b..018b4a9d 100644 --- a/app/controllers/vendor_controller.rb +++ b/app/controllers/vendor_controller.rb @@ -1,7 +1,8 @@ class VendorController < ApplicationController def index - if market = Market.find(params[:market_id]) + if params[:market_id] != nil + market = Market.find(params[:market_id]) @vendors = market.vendors return @vendors else @@ -12,7 +13,7 @@ def index def create @vendor = Vendor.create(vendor_params) - redirect_to root_path + redirect_to market_vendor_index_path(vendor_params[:market_id]) end def new @@ -39,6 +40,7 @@ def update def destroy @vendor = Vendor.find(params[:id]).destroy + redirect_to vendor_index_path end diff --git a/app/models/vendor.rb b/app/models/vendor.rb index fd5a3471..eb03ff1e 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -2,4 +2,10 @@ class Vendor < ActiveRecord::Base belongs_to :market has_many :products has_many :sales + + def add_vendor_link + if params[:market_id] != nil + return link_to "Add a new vendor for this market", new_market_vendor_path(@vendors[0].market_id) + end + end end diff --git a/app/views/market/destroy.html.erb b/app/views/market/destroy.html.erb deleted file mode 100644 index 9a7a9070..00000000 --- a/app/views/market/destroy.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

Market Deletion Confirmation

- -<%= "Market \"#{@market.name}\" has been deleted." %> diff --git a/app/views/vendor/destroy.html.erb b/app/views/vendor/destroy.html.erb deleted file mode 100644 index f2a21f78..00000000 --- a/app/views/vendor/destroy.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

Vendor Deletion Confirmation

- -<%= "Vendor \"#{@vendor.name}\" has been deleted." %> diff --git a/app/views/vendor/index.html.erb b/app/views/vendor/index.html.erb index 80ffb1f5..aeff2c48 100644 --- a/app/views/vendor/index.html.erb +++ b/app/views/vendor/index.html.erb @@ -1,6 +1,11 @@ <%= @page_name = 'View All Vendors'%> + +<% if params[:market_id] != nil %> +

<%= link_to "Add a new vendor for this market", new_market_vendor_path(@vendors[0].market_id) %>

+<% end %> + From 071b4a8909b1169a56ed4037e218b19557147430 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 16:53:44 -0700 Subject: [PATCH 26/43] We tried to do something in the vendor model, but decided to stop. --- app/models/vendor.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/models/vendor.rb b/app/models/vendor.rb index eb03ff1e..f8f66089 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -3,9 +3,4 @@ class Vendor < ActiveRecord::Base has_many :products has_many :sales - def add_vendor_link - if params[:market_id] != nil - return link_to "Add a new vendor for this market", new_market_vendor_path(@vendors[0].market_id) - end - end end From e75e4bffb2e9275cc7d887f1be42bdabef6a03a4 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 22:28:52 -0700 Subject: [PATCH 27/43] Added all the pages for sales-related things, most links probably work. --- app/controllers/sale_controller.rb | 44 ++++++++++++++++++++++++++++++ app/helpers/sale_helper.rb | 2 ++ app/models/sale.rb | 4 +++ app/views/sale/_sale_form.html.erb | 35 ++++++++++++++++++++++++ app/views/sale/edit.html.erb | 13 +++++++++ app/views/sale/index.html.erb | 25 +++++++++++++++++ app/views/sale/new.html.erb | 15 ++++++++++ app/views/sale/show.html.erb | 23 ++++++++++++++++ 8 files changed, 161 insertions(+) create mode 100644 app/views/sale/_sale_form.html.erb create mode 100644 app/views/sale/edit.html.erb create mode 100644 app/views/sale/index.html.erb create mode 100644 app/views/sale/new.html.erb create mode 100644 app/views/sale/show.html.erb diff --git a/app/controllers/sale_controller.rb b/app/controllers/sale_controller.rb index 98c1c05e..d83b2371 100644 --- a/app/controllers/sale_controller.rb +++ b/app/controllers/sale_controller.rb @@ -1,12 +1,56 @@ class SaleController < ApplicationController + require 'path_check.rb' + include PathCheck + + def index + if product_sale? + product = Product.find(params[:product_id]) + @sales = Sale.where(:product_id => product.id) + else vendor_sale? + vendor = Vendor.find(params[:vendor_id]) + @sales = Sale.where(:vendor_id => vendor.id) + end + end def create + @sale = Sale.create(sale_params) + redirect_to vendor_sale_index_path end def new + @sale = Sale.new end def edit + @sale = Sale.find(params[:id]) + end + + def update + @sale = Sale.find(params[:id]) + + if @sale.update(sale_params) + redirect_to vendor_sale_index_path + else + render :edit + end + end + + def show + @sale = Sale.find(params[:id]) end + def destroy + @sale = Sale.find(params[:id]).destroy + redirect_to vendor_sale_index_path + end + + ####### STRONG PARAMS ######### + + private + + def sale_params + params.require(:sale).permit(:name, :vendor_id) + end + + end diff --git a/app/helpers/sale_helper.rb b/app/helpers/sale_helper.rb index 0f1c4ed9..4396f71a 100644 --- a/app/helpers/sale_helper.rb +++ b/app/helpers/sale_helper.rb @@ -1,2 +1,4 @@ module SaleHelper + require 'path_check.rb' + include PathCheck end diff --git a/app/models/sale.rb b/app/models/sale.rb index 613c86b2..59bb8c55 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -1,4 +1,8 @@ class Sale < ActiveRecord::Base belongs_to :product belongs_to :vendor + + require 'path_check.rb' + include PathCheck + end diff --git a/app/views/sale/_sale_form.html.erb b/app/views/sale/_sale_form.html.erb new file mode 100644 index 00000000..e5d17fb0 --- /dev/null +++ b/app/views/sale/_sale_form.html.erb @@ -0,0 +1,35 @@ +<% if @sale.errors.any? %> +
    + <% @sale.errors.each do |error, message| %> +
  • <%= error.upcase %><%= message %>
  • + <% end %> +
+<% end %> + + +<%= form_for @sale, url: path, method: http_method do |f| %> +
Vendor Name
+ + + + + + + + + + + + + + + + + + + + + + +
<%= f.label :amount %> <%= f.text_field :amount, :size => 100 %>
<%= f.label :purchase_time %> <%= f.datetime_field :purchase_time, :size => 100 %>
<%= f.label :vendor_id %> <%= f.text_field :vendor_id, :size => 100 %>
<%= f.label :product_id %> <%= f.text_field :product_id, :size => 100 %>
<%= f.submit "Set Sale!" %>
+<% end %> diff --git a/app/views/sale/edit.html.erb b/app/views/sale/edit.html.erb new file mode 100644 index 00000000..2d433c87 --- /dev/null +++ b/app/views/sale/edit.html.erb @@ -0,0 +1,13 @@ +<% if product_sale? %> + <% product = Product.find(params[:product_id]) %> +

<%= product.vendor.name %>

+

Edit sale

+ <%= render partial: "sale_form", locals: {path: edit_product_sale_index_path, http_method: :patch} %> + +<% elsif vendor_sale? %> +

<%= Vendor.find(params[:vendor_id]).name %>

+

Edit sale

+ <%= render partial: "sale_form", locals: {path: edit_vendor_sale_index_path, http_method: :patch} %> +<% else %> + <%= puts "Error on add new sale page" %> +<% end %> diff --git a/app/views/sale/index.html.erb b/app/views/sale/index.html.erb new file mode 100644 index 00000000..c34afb9b --- /dev/null +++ b/app/views/sale/index.html.erb @@ -0,0 +1,25 @@ +

<%= Vendor.find(@sales[0].vendor_id).name %>'s Products

+

Market: <%= Market.find(@sales[0].vendor_id).name %>

+ + + + + + + + <% @sales.each do |sale| %> + + + + + + <% end %> +
Sale IDAmountActions
<%= sale.id %>$<%= sale.amount / 100 %> + <%= link_to "[Edit]", edit_vendor_sale_path(sale.vendor_id, sale.id) %> + <%= link_to "[Delete]", vendor_sale_path(sale.vendor_id, sale.id), method: :delete, data: { confirm: "Really, now?" } %>
+ +<% if product_sale? %> +

<%= link_to "Add a new sale!", new_product_sale_path %>

+<% else vendor_sale? %> +

<%= link_to "Add a new sale!", new_vendor_sale_path %>

+<% end %> diff --git a/app/views/sale/new.html.erb b/app/views/sale/new.html.erb new file mode 100644 index 00000000..6966a00c --- /dev/null +++ b/app/views/sale/new.html.erb @@ -0,0 +1,15 @@ + +<% if product_sale? %> + <% product = Product.find(params[:product_id]) %> +

<%= product.vendor.name %>

+

Add new sale

+ <%= render partial: "sale_form", locals: {path: product_sale_index_path, http_method: :post} %> + +<% elsif vendor_sale? %> +

<%= Vendor.find(params[:vendor_id]).name %>

+

Add new sale

+ <%= render partial: "sale_form", locals: {path: vendor_sale_index_path, http_method: :post} %> + +<% else %> + <%= puts "Error on add new sale page" %> +<% end %> diff --git a/app/views/sale/show.html.erb b/app/views/sale/show.html.erb new file mode 100644 index 00000000..37cb47b4 --- /dev/null +++ b/app/views/sale/show.html.erb @@ -0,0 +1,23 @@ +

Detailed Sale Page

+ + + + + + + + + + + + + + + + +
Sale IDAmountPurchase TimeVendor IDMarket ID
<%= @sale.id %>$<%= @sale.amount / 100 %><%= @sale.purchase_time %><%= @sale.vendor_id %><%= @sale.market_id %>
+ +

<%= link_to "Back to all sales", vendor_sale_index_path %>

+ +
+<%= button_to "Delete this sale", {:action => 'destroy', :id => @sale.id }, :method => :delete, data: { confirm: "Really, now?" } %> From 65f19a25ef6420de4dcf2e38a3f7a6a5dbd1b2c1 Mon Sep 17 00:00:00 2001 From: Nicole Url Date: Thu, 6 Oct 2016 22:30:05 -0700 Subject: [PATCH 28/43] Added a mixin for methods to determine which path we're on - vendor, product, or market --- app/views/product/show.html.erb | 1 + app/views/vendor/show.html.erb | 2 +- config/routes.rb | 5 ++++- lib/path_check.rb | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 lib/path_check.rb diff --git a/app/views/product/show.html.erb b/app/views/product/show.html.erb index 68668d02..994ef3f2 100644 --- a/app/views/product/show.html.erb +++ b/app/views/product/show.html.erb @@ -14,6 +14,7 @@

<%= link_to "Back to all products", vendor_product_index_path %>

+

<%= link_to "Add a new sale for this product", new_product_sale_path(@product.id) %>


<%= button_to "Delete this product", {:action => 'destroy', :id => @product.id }, :method => :delete, data: { confirm: "Really, now?" } %> diff --git a/app/views/vendor/show.html.erb b/app/views/vendor/show.html.erb index c121b5ec..6e9a587b 100644 --- a/app/views/vendor/show.html.erb +++ b/app/views/vendor/show.html.erb @@ -19,7 +19,7 @@

<%= link_to "Back to all vendors", vendor_index_path %>

- +

<%= link_to "Add a new sale", new_vendor_sale_path(@vendor.id) %>

<%= link_to "View all products", vendor_product_index_path(params[:id]) %>


diff --git a/config/routes.rb b/config/routes.rb index 5880729b..70e862b4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,7 +12,10 @@ resources :product, :sale end - + # Getting to sales through product + resources :product, only: [:index, :new, :create] do + resources :sale + end # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/lib/path_check.rb b/lib/path_check.rb new file mode 100644 index 00000000..bd674783 --- /dev/null +++ b/lib/path_check.rb @@ -0,0 +1,19 @@ +module PathCheck + def product_sale? + if params[:product_id] != nil + return true + end + end + + def vendor_sale? + if params[:vendor_id] != nil + return true + end + end + + def market_sale? + if params[:market_id] != nil + return true + end + end +end From 226ac6bcee038eda7b79245dd465a96c600b0277 Mon Sep 17 00:00:00 2001 From: Yeni Date: Thu, 6 Oct 2016 23:28:57 -0700 Subject: [PATCH 29/43] cleaned up css and layout for market. --- .DS_Store | Bin 0 -> 6148 bytes app/assets/stylesheets/application.css | 73 +++++++++++++++++++++---- app/assets/stylesheets/homepage.scss | 0 app/assets/stylesheets/vendor.scss | 3 - app/views/homepage/index.html.erb | 10 ++-- app/views/layouts/application.html.erb | 1 + app/views/market/_market_form.html.erb | 7 ++- app/views/market/index.html.erb | 13 +++-- app/views/market/new.html.erb | 1 - app/views/market/show.html.erb | 20 ++++--- 10 files changed, 91 insertions(+), 37 deletions(-) create mode 100644 .DS_Store delete mode 100644 app/assets/stylesheets/homepage.scss delete mode 100644 app/assets/stylesheets/vendor.scss diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..53978ec1ed271a1f6d00002b16f89192c47b319c GIT binary patch literal 6148 zcmeHKOKuuL5PiiU0yt7EW#i>6y+ZO0CKe=O;f-?uJA8}~7!a5!%Q;34l>_7mz6E(z z-LkqHvb8L$OX_+vJ+Hc}UNh4)0J+{zu7Gm@Z8pVbm+pk=b8Sb~@I9Z2qGPPbqvd+U zI~^`tRv;_z))mlqx4;i^Xitg*raxwDunw+Xis za?!&U`y}FT64Af}qnHED^LLQv2TVEAgyU`K9}>3a8?(QW|7iIxF^$=lamfCNh|M{c ztagk=5~q2GaRqtvQ<+OU$Xr?LR5dW;h}9)$%N1K;#>{)1eUEKCe`Cm)Ps~9M2YR4I zE%sbL&0-vLwZ>@tHf}lkf@A9%9&5tdB7TSb0luJ*8)A=IPU0DKh2&RI=UEb=t3?%) zD6Kn;>R`v5rsUqS<{f@w7e`nnVMG&8h~|tLDntKIHl^EYofQU zQOGsX-@N0Vt=2wsn0;0tE07gBC7WX9v36*m4mvvm5S#2a0op$muD%pAwhEdGQd{^%j4(IJ(??6U${fmngU-Ja|I zKluOoKMu-wS%Iv;yHY@!{qOy2mgM)=qvCY0E!pnb)Rb2{v=BPK9ovO&#TRU5d{*iO WvGQ0uWDhO>5il9D%L=@z0{;M7?f4b| literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 1f6630a6..dc7ede6c 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,3 +1,7 @@ +main { + margin-bottom: 10%; +} + a:hover { color: #666699; } @@ -5,17 +9,27 @@ a:hover { a { color: #F5B19A; font-family: 'Quicksand'; + text-decoration: none; } -footer a { - color: #F5B19A; +.main-page-middle { + color: white; + text-decoration: none; } +.main-page-middle:hover { + color: white; +} +h6 { + text-align: center; + font-family: 'Quicksand', serif; + color: #F5B19A; +} h1 { text-align: center; - font-family: 'Poiret One', serif; + font-family: 'Quicksand', serif; font-size: 4em; - color: #C28599; + color: #F5B19A; /*background-color: #efefef;*/ } @@ -23,19 +37,49 @@ h1 { margin-top: 30px; }*/ +.add-market { + margin-top: 5%; + text-align: center; +} + +.market-table { + margin-left: 29%; +} + +.market-table tr { + color: grey; +} + +.market-form { + margin-left: 20%; +} + +.market-details { + margin-left: 20%; +} +.table-info td { + padding-right: 3%; + color: #F5B19A; +} + nav{ margin-left: 8%; +margin-bottom: 5%; +} + +nav a { + color: grey; } .top-buttons li { display: inline; font-family: 'Julius Sans One', sans-serif; - border-right: 2pt solid #F5B19A; + border-bottom: 2pt solid #F5B19A; color: #666699; /*previous color #39324b*/ margin-right: 8%; margin-left: 8%; - padding: 0 25px; + padding: 5px 25px; font-size: 9pt; } @@ -48,9 +92,10 @@ footer { background-color: #efefef; text-align: center; margin-top: 5%; + position: fixed; } -.bottom-buttons li{ +/*.bottom-buttons li{ display: inline; font-family: 'Julius Sans One', sans-serif; border-right: 2pt solid #39324b; @@ -59,7 +104,7 @@ footer { margin-left: 8%; padding: 0px 25px; font-size: 9pt; -} +}*/ h3 { @@ -70,14 +115,13 @@ h3 { color: white; border-radius: 25px; background-size: 280px 260px; - /*padding will add an empty h3 background to a page that has no h3 field*/ - /*padding: 3% 3%;*/ - margin: 5% 10%; + margin: 0 10%; background-repeat: repeat; opacity: 0.7; background-image: url("http://abwatercolors.com/wp-content/uploads/2012/11/farmersMarket.jpg"); } +/*middle pictures in home page*/ h2 { text-align: center; font-family: 'Quicksand', serif; @@ -99,15 +143,20 @@ table { font-size: 14px; line-height: 25px; } + th { + border-bottom: 2pt solid grey; text-align: left; } main table { - margin-top: 6%; + /*margin-top: 6%;*/ margin-left: 35%; } +footer a { + color: #F5B19A; +} /*.table-top * { margin: 0 20%; } diff --git a/app/assets/stylesheets/homepage.scss b/app/assets/stylesheets/homepage.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/app/assets/stylesheets/vendor.scss b/app/assets/stylesheets/vendor.scss deleted file mode 100644 index e0a50da6..00000000 --- a/app/assets/stylesheets/vendor.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the vendor controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/views/homepage/index.html.erb b/app/views/homepage/index.html.erb index 5126cdc9..25a561c9 100644 --- a/app/views/homepage/index.html.erb +++ b/app/views/homepage/index.html.erb @@ -2,13 +2,15 @@ - <%= @title = 'Welcome to FarMar Database!'%> - + + <% @little_title = 'welcome to'%> + <%= @title = '~FARMAR HELL~'%> +
-

ACT AS A MARKET

-

ACT AS A VENDOR

+

ACT AS A MARKET

+

ACT AS A VENDOR

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1a87a8ca..97a2674e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,6 +10,7 @@
+
<%= @little_title %>

<%= @title %>

<%= @page_name %>

From 19dbdb9cb657c63d4bbebf12017353f3d4d73ca0 Mon Sep 17 00:00:00 2001 From: Yeni Date: Sat, 8 Oct 2016 19:45:32 -0700 Subject: [PATCH 42/43] testing correct links to nav bar -take 3 --- .DS_Store | Bin 6148 -> 8196 bytes app/views/layouts/application.html.erb | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 53978ec1ed271a1f6d00002b16f89192c47b319c..b0d73ff8d7380349a0e382bd92684c3c177be1f6 100644 GIT binary patch delta 414 zcmZoMXmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD6%nNH}hr%jz7$c**Q2SHn1>? zOy*&cs|RWO{~t&)FfcPDG88ZrB$XEzB<18M0Y$zi735?Vmlzn_WMpDyVP#|I;N;>4 zK>+(1Xc#MrF1R-l7}Lt4|+(KoW7wrkPiB}gjfIxs7NVtOR+F1CVc{0C@C&*?7CWtFQ4rACH&ohS^0M$GpGynhq diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 42732e64..2a6296ba 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -15,9 +15,9 @@

<%= @page_name %>