Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Market controller #28

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e5c4dd1
test on readme
Oct 4, 2016
0c9797d
generated general user controller, model for markets, vendors, produc…
goaskcarmen Oct 4, 2016
94c44c5
added ERD diagram in app/assets/images
Oct 5, 2016
0f4da78
imported data
goaskcarmen Oct 5, 2016
9f38d61
added index page
goaskcarmen Oct 5, 2016
059df0e
for updating delelopment
Oct 5, 2016
9deef05
deleted development log
Oct 5, 2016
94e527f
set up index page
Oct 5, 2016
cc8c3b5
completed general_user view page with market list and vendor lists
Oct 5, 2016
4fc77ca
generated vendors controller
Oct 5, 2016
2fedcc0
added market form
goaskcarmen Oct 5, 2016
083e9ab
merge
goaskcarmen Oct 5, 2016
c1c577f
Merge pull request #1 from goaskcarmen/marketController
goaskcarmen Oct 5, 2016
25f6aa4
completed create a vendor feature. used dropdown to let user to selec…
Oct 6, 2016
e8ffb5d
edit a vendor feature. Also link to vendor index from main page
Oct 6, 2016
49913ed
completed delete a vendor feature
Oct 6, 2016
7028a61
completed market modification
goaskcarmen Oct 7, 2016
ab25638
vendor can create, edit and delete a product
Oct 7, 2016
d3cc3b5
merged createNewVendor branch
Oct 7, 2016
59e838f
merge
goaskcarmen Oct 7, 2016
aaf3118
Merge pull request #3 from goaskcarmen/marketController
goaskcarmen Oct 7, 2016
c653119
postgres for production gem
goaskcarmen Oct 7, 2016
8050c5d
added gemfile.lock
goaskcarmen Oct 7, 2016
3ae8607
completed market controller tasks and added validation
goaskcarmen Oct 7, 2016
b4b8b83
completed as a vendor user, I can view a list of Sales. working on cr…
Oct 7, 2016
f3fc76e
merge
goaskcarmen Oct 7, 2016
aaa0893
Merge pull request #4 from goaskcarmen/marketController
goaskcarmen Oct 7, 2016
656feca
submit
goaskcarmen Oct 8, 2016
e6199b0
Remove temp file
Oct 8, 2016
c4b3f60
remove Gemfile.lock, it's machine depedent and should be regenerated …
Oct 8, 2016
5973381
update gitignore
Oct 8, 2016
5ac48e0
fix routes naming convention
Oct 8, 2016
bc54e3e
add sales for product feature done
Oct 8, 2016
b5e52b5
show total sales feature done
Oct 8, 2016
538e6cf
completed total sales for current month. debugging
Oct 8, 2016
6b71ea4
completed and tested total sales in current month
Oct 9, 2016
0ecf3b4
completed sales list in current month
Oct 9, 2016
c6e2ba6
converted sales from cents to dollor in model
Oct 9, 2016
f1d2bcc
basic layout setup for index, market and vendor index
Oct 9, 2016
aa02114
improved layout of indexes and create form for all accounts
Oct 11, 2016
8dc0334
corrected @product intead of haha_product in Vendor edit view
Oct 11, 2016
038bf0f
Merge pull request #5 from goaskcarmen/sales
goaskcarmen Oct 12, 2016
e60c358
added sort to the market list
goaskcarmen Oct 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added market form
  • Loading branch information
goaskcarmen committed Oct 5, 2016
commit 2fedcc072bc952a6bf26963dac1de6da2ff83fdd
3 changes: 3 additions & 0 deletions app/assets/javascripts/markets.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/markets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the markets controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
23 changes: 23 additions & 0 deletions app/controllers/markets_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class MarketsController < ApplicationController
def index
end

def show
end

def create
end

def new
@newmarket = Market.new
end

def edit
end

def update
end

def destroy
end
end
2 changes: 2 additions & 0 deletions app/helpers/markets_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MarketsHelper
end
24 changes: 24 additions & 0 deletions app/views/markets/_marketform.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<h1>Add a Market </h1>
<article>
<%= form_for @newmarket, url: action_name do |f| %>
<ul>
<li><%= f.label :name %></li>
<li><%= f.text_field :name %></li>

<li><%= f.label :street %></li>
<li><%= f.text_field :street %></li>

<li><%= f.label :city %></li>
<li><%= f.text_field :city %></li>

<li><%= f.label :county %></li>
<li><%= f.text_field :county %></li>

<li><%= f.label :state %></li>
<li><%= f.text_field :state %></li>

<li><%= f.label :zip %></li>
<li><%= f.text_field :zip %></li>
</ul>

</article>
2 changes: 2 additions & 0 deletions app/views/markets/create.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#create</h1>
<p>Find me in app/views/markets/create.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/destroy.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#destroy</h1>
<p>Find me in app/views/markets/destroy.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/edit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#edit</h1>
<p>Find me in app/views/markets/edit.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#index</h1>
<p>Find me in app/views/markets/index.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#new</h1>
<p>Find me in app/views/markets/new.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#show</h1>
<p>Find me in app/views/markets/show.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/markets/update.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Markets#update</h1>
<p>Find me in app/views/markets/update.html.erb</p>
15 changes: 15 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
Rails.application.routes.draw do
get 'markets/index'

get 'markets/show'

get 'markets/create'

get 'markets/new'

get 'markets/edit'

get 'markets/update'

get 'markets/destroy'


get 'vender_user/index'

get 'vender_user/show'
39 changes: 39 additions & 0 deletions test/controllers/markets_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require 'test_helper'

class MarketsControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end

test "should get show" do
get :show
assert_response :success
end

test "should get create" do
get :create
assert_response :success
end

test "should get new" do
get :new
assert_response :success
end

test "should get edit" do
get :edit
assert_response :success
end

test "should get update" do
get :update
assert_response :success
end

test "should get destroy" do
get :destroy
assert_response :success
end

end