-
Notifications
You must be signed in to change notification settings - Fork 0
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 #39 from RileyManda/feature/ui-navigation
Feature/UI navigation
- Loading branch information
Showing
9 changed files
with
87 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ShoppingController < ApplicationController | ||
def index; 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,2 @@ | ||
module ShoppingHelper | ||
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="container"> | ||
<h1>Shopping List</h1> | ||
<div class="d-flex justify-content-between"> | ||
<p>Amount of food to buy:</p> | ||
|
||
<div> | ||
Recipe: Recipe2Link | ||
</div> | ||
|
||
</div> | ||
<p>Total value of of food needed:</p> | ||
<div> | ||
Inventory: Inventory1 | ||
</div> | ||
<div class="mt-4"> | ||
<table class="table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Food</th> | ||
<th>Quantity</th> | ||
<th>Price</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% if @recipe_foods.present? %> | ||
<% @recipe_foods.each do |recipe_food| %> | ||
<tr> | ||
<td><%= recipe_food.food.name %></td> | ||
<td><%= recipe_food.quantity %>g</td> | ||
<td>$<%= recipe_food.quantity * recipe_food.food.price %></td> | ||
<td> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% else %> | ||
<tr> | ||
<td colspan="4">No shopping list available.</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
<%= link_to '< Back To All Recipes', recipe_index_path, class: 'btn small btn-primary' %> | ||
</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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the ShoppingHelper. For example: | ||
# | ||
# describe ShoppingHelper 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 ShoppingHelper, type: :helper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
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,10 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Shoppings', type: :request do | ||
describe 'GET /index' do | ||
it 'returns http success' do | ||
get '/shopping/index' | ||
expect(response).to have_http_status(:success) | ||
end | ||
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 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'shopping/index.html.erb', type: :view do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |