-
Notifications
You must be signed in to change notification settings - Fork 15
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
Beyoncy - Rachel, Lauren, Joanna, and Alyssa #39
base: master
Are you sure you want to change the base?
Conversation
Copied from beyoncy
How did your team work together?
TECHNICAL
Overall, I feel so proud of my team and I am excited with the final project. There is always room to improve, but I think with the time we had, we rocked it. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpavilanis @alyssahursh @laurenfb @jm-rives
I've added an overall view in your progress reports document, but I have specific code-related comments here, so you can see what I'm talking about specifically.
Overall well done. Looks like some more work needed to be done with testing, styling and some work with controllers, but overall very nice.
|
||
already_in = false | ||
|
||
@order.order_products.each do |order_product| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can work around the need for this if statement by doing an:
Order_Product.where(order_id: @order.id).where(product_id: params[:order_products][:id].to_i)
@@ -0,0 +1,4 @@ | |||
<% if flash[:notice] %> | |||
<%= flash[:notice] %> | |||
<% flash[:notice] = nil %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize I'd shown the <% flash[:notice] = nil %>
, but it's not needed. You can just display the flash notice and it'll be gone in the next page load.
Good use of a partial though, although you might consider some formatting.
<body> | ||
<header> | ||
<nav> | ||
<ul class="vertical menu medium-horizontal" data-responsive-menu="accordion medium-dropdown"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work using responsive menus. Some more work needs to be done on backgrounds to the top-bar when it gets to smaller screen sizes.
@@ -0,0 +1,16 @@ | |||
<table> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of partials
@@ -0,0 +1,46 @@ | |||
require 'test_helper' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work putting in tests for the view helpers.
@@ -2,4 +2,11 @@ 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 | |||
|
|||
before_filter :set_categories | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to load the categories on each page? This will always run.
|
||
private | ||
def find_category | ||
@category = Category.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find will actually throw an Error if the method fails, so the if @category.nil? will never execute. If you want to do this you should use Category.find_by instead.
if order_product.product_id.to_i == params[:order_products][:id].to_i | ||
already_in = true | ||
@order_product = OrderProduct.find(order_product.id) | ||
@order_product.save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You find an order_product and then save it to the database without changing anything here.
|
||
if @order_product.save | ||
redirect_to '/cart' | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably use a named route instead of '/cart'
# end | ||
# end | ||
|
||
def edit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think the edit method here should be using session to find the user or using the filter to find the value for the @user attribute.
@CheezItMan
Rachel, Lauren, Joanna, and Alyssa