forked from Ada-C6/betsy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from mayawang/ev_add_product
Ev add product
- Loading branch information
Showing
20 changed files
with
121 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div class="basic"> | ||
<%= form_for @product, url: action_name do |f| %> | ||
|
||
<div class="field"> | ||
<%= f.label "Product Name" %> | ||
<%= f.text_field :name, "Product Name" => nil, :required => true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label "Description" %> | ||
<%= f.text_field :description, "Description" => nil, :required => true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label "Price" %> | ||
<%= f.number_field :price, "Price" => nil, :required => true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label "Inventory" %> | ||
<%= f.number_field :inventory, "Inventory" => nil, :required => true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label "Category" %> | ||
<%= f.select :category, Product.uniq.pluck(:category), "Category" => nil, :required => true %> | ||
</div> | ||
|
||
<%= f.submit "Create New Product", class: 'button' %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
<h1>Products#create</h1> | ||
<p>Find me in app/views/products/create.html.erb</p> | ||
<%# params %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
<h1>Products#new</h1> | ||
<p>Find me in app/views/products/new.html.erb</p> | ||
<div class="basic"> | ||
<% if session[:user_id] != nil %> | ||
<h2>Post a New Product</h2> | ||
<%= render partial: "form", locals: {action_name: "create"}%> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<h1>Collections by this Seller:</h1> | ||
<% @products.each do |product| %> | ||
<p><%= link_to image_tag("product.photo_url"), show_products_path(product.id), { :class => "product_img" } %></p> | ||
<p><%= link_to product.name, show_products_path(product.id) %></p> | ||
<p><%= product.price %></p> | ||
<% end %> | ||
<div class="basic"> | ||
<div class="columns"> | ||
<h2>Collections by this Seller:</h2> | ||
<% @products.each do |product| %> | ||
<p><%= link_to image_tag(product.photo_url), show_products_path(product.id), :class => "photo" %></p> | ||
<p><%= link_to product.name, show_products_path(product.id) %></p> | ||
<p><%= product.price %></p> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# config.omniauth :github, "4fa0e3e1a1c088c7fba0", "0644062e493cedc8b257f39abdfd768c653b5983" | ||
# | ||
# config.omniauth :github, "4fa0e3e1a1c088c7fba0", "0644062e493cedc8b257f39abdfd768c653b5983", callback_url: "http://localhost:3000/auth/github/callback" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveLastNameFromUsers < ActiveRecord::Migration | ||
def change | ||
remove_column :users, :last_name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RenameFirstNameColumnUsers < ActiveRecord::Migration | ||
def change | ||
rename_column :users, :first_name, :name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
1,"Rusty","Rail","rusty@vampires.io","123 Madison Ave","Seattle","WA",98102,2062222222,true,"github" | ||
2,"Sally Beth","Walcott","sally@vampires.io","1700 Undead Lane","Ruidoso","NM",88345,5055555555,true,"github" | ||
3,"Lestat","Jones","lestat@aol.com","541 Old Hidden Country Route 5 North","Flushing","MI",48433,8108888888,true,"github" | ||
4,"Madeleine","Kinoko","maddy@mushroom.com","700 Ocarina Way Apt 2","Phoenix","AZ",85345,6022222222,true,"github" | ||
5,"Juanita","Torres","juanita@aol.com","814 East Archer Drive","Ruidoso","NM",88355,5054444444,true,"github" | ||
6,"Marcy","Ogulo","marcy@vampires.io","10109 Eldritch Circle","Phoenix","AZ",85003,6233333333,true,"github" | ||
7,"Laila","Satrapi","laila@gmail.com","222 Lugosi Lane #C","Seattle","WA",98104,2066666666,true,"github" | ||
8,"Ambrose","Ardenmoor","ambrose@vampires.io","3 Unseen Court","Casper","WY",82002,8777777777,true,"github" | ||
1,"Rusty Rail","rusty@vampires.io","123 Madison Ave","Seattle","WA",98102,2062222222,true,"github" | ||
2,"Sally Beth Walcott","sally@vampires.io","1700 Undead Lane","Ruidoso","NM",88345,5055555555,true,"github" | ||
3,"Lestat Jones","lestat@aol.com","541 Old Hidden Country Route 5 North","Flushing","MI",48433,8108888888,true,"github" | ||
4,"Madeleine Kinoko","maddy@mushroom.com","700 Ocarina Way Apt 2","Phoenix","AZ",85345,6022222222,true,"github" | ||
5,"Juanita Torres","juanita@aol.com","814 East Archer Drive","Ruidoso","NM",88355,5054444444,true,"github" | ||
6,"Marcy Ogulo","marcy@vampires.io","10109 Eldritch Circle","Phoenix","AZ",85003,6233333333,true,"github" | ||
7,"Laila Satrapi","laila@gmail.com","222 Lugosi Lane #C","Seattle","WA",98104,2066666666,true,"github" | ||
8,"Ambrose Ardenmoor","ambrose@vampires.io","3 Unseen Court","Casper","WY",82002,8777777777,true,"github" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters