From b1d47b05c8cc3d16763dffd9cecb6d4c34c50e46 Mon Sep 17 00:00:00 2001 From: "Brittany L. Walentin" Date: Mon, 27 Jul 2015 16:42:11 -0700 Subject: [PATCH 001/143] Recipe Seeds. --- db/RecipeSeeds.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 db/RecipeSeeds.csv diff --git a/db/RecipeSeeds.csv b/db/RecipeSeeds.csv new file mode 100644 index 00000000..9972e2aa --- /dev/null +++ b/db/RecipeSeeds.csv @@ -0,0 +1 @@ +name,description,image url,preparation Salsa Chicken,Quick and easy mexican style crock pot recipe,,"Add Chicken to crock pot, and all other ingredients on top. Cook on low for 6 hours" Witches Brew,For a spooky halloween night,,Combine mud and water until desired consistency. Add grass and earthworms as a garnish. Serve chilled Soft Chocolate Chip Cookies,"Very delicious, you can use any flavor pudding you like for this recipe.",,"Preheat oven to 350 degrees F (175 degrees C). Sift together the flour and baking soda, set aside. In a large bowl, cream together the butter, brown sugar, and white sugar. Beat in the instant pudding mix until blended. Stir in the eggs and vanilla. Blend in the flour Bake for 10 to 12 minutes in the preheated oven. Edges should be golden brown.mixture. Finally, stir in the chocolate chips and nuts. Drop cookies by rounded spoonfuls onto ungreased cookie sheets." Peanut Butter & Jam Sando,The golden oldie; never gets old,,Apply peanut butter to one piece of bread. Add jam to the top to desired height. Enjoy Fried Chicken,Finger licking-greasy good,,"Heat oil in deep fryer, apply batter to chicken until coated. Add to fryer until golden brown. Towel dry." \ No newline at end of file From 07566adf434db94840f7033a4bfd6319adefdd8e Mon Sep 17 00:00:00 2001 From: "Brittany L. Walentin" Date: Mon, 27 Jul 2015 17:22:15 -0700 Subject: [PATCH 002/143] WIP: home view. --- app/assets/javascripts/application.js | 1 + app/assets/javascripts/home.coffee | 3 +++ app/assets/javascripts/sessions.coffee | 3 +++ .../{application.css => application.scss} | 0 app/assets/stylesheets/home.scss | 3 +++ app/assets/stylesheets/sessions.scss | 3 +++ app/controllers/home_controller.rb | 2 ++ app/controllers/sessions_controller.rb | 2 ++ app/helpers/home_helper.rb | 2 ++ app/helpers/sessions_helper.rb | 2 ++ app/views/home/index.html.erb | 1 + app/views/layouts/application.html.erb | 2 +- app/views/shared/_nav.html.erb | 12 ++++++++++++ config/routes.rb | 12 +++++++++++- scaffold.md | 1 + spec/controllers/home_controller_spec.rb | 5 +++++ spec/controllers/sessions_controller_spec.rb | 5 +++++ spec/helpers/home_helper_spec.rb | 15 +++++++++++++++ spec/helpers/sessions_helper_spec.rb | 15 +++++++++++++++ 19 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/home.coffee create mode 100644 app/assets/javascripts/sessions.coffee rename app/assets/stylesheets/{application.css => application.scss} (100%) create mode 100644 app/assets/stylesheets/home.scss create mode 100644 app/assets/stylesheets/sessions.scss create mode 100644 app/controllers/home_controller.rb create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/helpers/home_helper.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/views/home/index.html.erb create mode 100644 app/views/shared/_nav.html.erb create mode 100644 spec/controllers/home_controller_spec.rb create mode 100644 spec/controllers/sessions_controller_spec.rb create mode 100644 spec/helpers/home_helper_spec.rb create mode 100644 spec/helpers/sessions_helper_spec.rb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e07c5a83..74658567 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,4 +13,5 @@ //= require jquery //= require jquery_ujs //= require turbolinks +//= require bootstrap-sprockets //= require_tree . diff --git a/app/assets/javascripts/home.coffee b/app/assets/javascripts/home.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/home.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/sessions.coffee b/app/assets/javascripts/sessions.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/sessions.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/application.css b/app/assets/stylesheets/application.scss similarity index 100% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.scss diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 00000000..f0ddc684 --- /dev/null +++ b/app/assets/stylesheets/home.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the home 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/sessions.scss b/app/assets/stylesheets/sessions.scss new file mode 100644 index 00000000..7bef9cf8 --- /dev/null +++ b/app/assets/stylesheets/sessions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the sessions 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/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 00000000..fc0b4743 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,2 @@ +class HomeController < ApplicationController +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 00000000..16d11b57 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,2 @@ +class SessionsController < ApplicationController +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 00000000..23de56ac --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 00000000..309f8b2e --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 00000000..a57ad80a --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1 @@ +

Welcome to Recipe Picker

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 21fbaeb1..a7460b96 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tags %> - +<%= render 'shared/nav' %> <%= yield %> diff --git a/app/views/shared/_nav.html.erb b/app/views/shared/_nav.html.erb new file mode 100644 index 00000000..b63a0f73 --- /dev/null +++ b/app/views/shared/_nav.html.erb @@ -0,0 +1,12 @@ + diff --git a/config/routes.rb b/config/routes.rb index 3f66539d..0542a955 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,17 @@ # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" - # root 'welcome#index' + root 'home#index' + + # sessions paths + get "/login", to: "sessions#new" + post "/login", to: "sessions#create" + delete "/logout", to: "sessions#destroy" + + resources :recipes + resources :cookbooks + resources :ingredients + resources :users # Example of regular route: # get 'products/:id' => 'catalog#view' diff --git a/scaffold.md b/scaffold.md index a1cc385a..37e9d1bd 100644 --- a/scaffold.md +++ b/scaffold.md @@ -28,3 +28,4 @@ Recipes Cookbooks Users Sessions +Home diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb new file mode 100644 index 00000000..e672b25e --- /dev/null +++ b/spec/controllers/home_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe HomeController, type: :controller do + +end diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb new file mode 100644 index 00000000..003beded --- /dev/null +++ b/spec/controllers/sessions_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SessionsController, type: :controller do + +end diff --git a/spec/helpers/home_helper_spec.rb b/spec/helpers/home_helper_spec.rb new file mode 100644 index 00000000..e537d8d9 --- /dev/null +++ b/spec/helpers/home_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the HomeHelper. For example: +# +# describe HomeHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe HomeHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/sessions_helper_spec.rb b/spec/helpers/sessions_helper_spec.rb new file mode 100644 index 00000000..94841983 --- /dev/null +++ b/spec/helpers/sessions_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the SessionsHelper. For example: +# +# describe SessionsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe SessionsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end From b308ce79683e19d3f2ec5949bb4ae1e864fc31e0 Mon Sep 17 00:00:00 2001 From: "Brittany L. Walentin" Date: Mon, 27 Jul 2015 19:27:34 -0700 Subject: [PATCH 003/143] WIP: home page, and users-show page. --- app/assets/javascripts/users.coffee | 3 +++ app/assets/stylesheets/application.scss | 9 +++++++++ app/assets/stylesheets/users.scss | 3 +++ app/controllers/home_controller.rb | 4 ++++ app/controllers/users_controller.rb | 2 ++ app/helpers/users_helper.rb | 2 ++ app/models/user.rb | 2 ++ app/views/home/index.html.erb | 6 ++++++ app/views/layouts/application.html.erb | 8 +++++--- app/views/shared/_footer.html.erb | 7 +++++++ app/views/shared/_nav.html.erb | 25 +++++++++++++++---------- app/views/users/show.html.erb | 5 +++++ spec/helpers/users_helper_spec.rb | 15 +++++++++++++++ spec/models/user_spec.rb | 5 +++++ 14 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 app/assets/javascripts/users.coffee create mode 100644 app/assets/stylesheets/users.scss create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/models/user.rb create mode 100644 app/views/shared/_footer.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 spec/helpers/users_helper_spec.rb create mode 100644 spec/models/user_spec.rb diff --git a/app/assets/javascripts/users.coffee b/app/assets/javascripts/users.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/users.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/application.scss b/app/assets/stylesheets/application.scss index f9cd5b34..a0e42848 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,3 +1,4 @@ + /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. @@ -13,3 +14,11 @@ *= require_tree . *= require_self */ + + @import "bootstrap-sprockets"; + @import "bootstrap"; + + + .container { + margin-top: 15px + } diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss new file mode 100644 index 00000000..1efc835c --- /dev/null +++ b/app/assets/stylesheets/users.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users 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/home_controller.rb b/app/controllers/home_controller.rb index fc0b4743..cb3e23d7 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,2 +1,6 @@ class HomeController < ApplicationController + def index + + end + end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 00000000..3e74dea8 --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,2 @@ +class UsersController < ApplicationController +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 00000000..2310a240 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 00000000..4a57cf07 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ActiveRecord::Base +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index a57ad80a..5b6eaa7f 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1 +1,7 @@ +
+

Welcome to Recipe Picker

+

The home for Recipes

+
+ +

Here are a few recipes to check out!

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a7460b96..362d78c0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,8 +7,10 @@ <%= csrf_meta_tags %> -<%= render 'shared/nav' %> -<%= yield %> - +
+ <%= render "shared/nav" %> + <%= yield %> + <%= render "shared/footer" %> +
diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb new file mode 100644 index 00000000..f2ba9523 --- /dev/null +++ b/app/views/shared/_footer.html.erb @@ -0,0 +1,7 @@ +
+
+

copyright © WangWalentin <%= Time.now.year %> + Top

+ <%= link_to "Home", root_path %> +
+
diff --git a/app/views/shared/_nav.html.erb b/app/views/shared/_nav.html.erb index b63a0f73..b7b3cf19 100644 --- a/app/views/shared/_nav.html.erb +++ b/app/views/shared/_nav.html.erb @@ -1,12 +1,17 @@ -