-
Notifications
You must be signed in to change notification settings - Fork 14
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
RegrEtsy - Octos - Kat/Ari/Maria/Anne #19
base: master
Are you sure you want to change the base?
Conversation
Merging master remote to master
Merging master to remote master
Merging branch with master
bEtsyWhat We're Looking For
Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
|
||
resources :carts, only: [:show, :edit, :update] | ||
post '/carts', to: 'carts#add_to_cart', as: :add_to_cart | ||
post '/add', to: 'sessions#add_cart_product', as: :add_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.
While this route makes sense once you the controller and the action, just "/add" by itself doesn't provide enough information about what it does
|
||
def finalize | ||
@paymentinfo = Buyerdetail.new(payment_params) | ||
@paymentinfo.assign_attributes(order_id: @order.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.
Using assign_attributes
is great to use with a hash of data, but when you're setting a single property, you should just use the dot method. So @paymentinfo.order_id = @order.id
instead.
@customer = Buyerdetail.find_by(id: @order.buyerdetail_id) | ||
end | ||
|
||
def order_status |
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.
If this is specifically for cancelling the orders, this could be named more explicitly
@product.assign_attributes(product_params) | ||
|
||
if @product.save | ||
redirect_to product_path(@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 should have some flash messages here and in the destory
method below
|
||
create_table "reviews", force: :cascade do |t| | ||
t.integer "rating" | ||
t.text "review" |
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 would not create a column within a table with the same name, recommend using "description" or "details" which would better describe the columns data
<% end %> | ||
<p> | ||
|
||
<% if item.reviews.count == 1 %> |
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 should be able to conditional display "review" or "reviews" without duplicating the entire link_to
<td><%= number_to_currency product.price %></td> | ||
<td> | ||
<td><%=item.quantity%></td> | ||
<% if quantity_edit?(request.fullpath) %> |
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.
The contents of this conditional is another example of encapsulating more than it needs. You should be able to change the submit_tag
only, not the entire form, since the rest is the same.
<nav> | ||
<ul class="menu"> | ||
|
||
<li class="menu-item-has-children"><%= link_to "Browse", root_path%> |
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 like the way you used these menus, its nice!
<%= link_to"Add a Category", new_category_path, class: 'hollow button' %> | ||
</section> | ||
|
||
<section class="tabset"> |
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.
The tabs add a nice UI element
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
|
||
|
||
.parallax-1 { |
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.
Each of the parallax styles are the same except for the image. You should be using one general class that includes all of the common parallax features, and then add another class for each specific image.
bEtsy
Congratulations! You're submitting your assignment! These comprehension questions should be answered by all members of your team, not by a single teammate.
Comprehension Questions