-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update code styles for /cart #1727
Conversation
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.
All good by me, thanks @vfonic
@@ -16,7 +16,7 @@ | |||
<div data-hook="inside_cart_form"> | |||
|
|||
<div data-hook="cart_items"> | |||
<%= render :partial => 'form', :locals => { :order_form => order_form } %> | |||
<%= render 'form', order_form: order_form, order: @order %> |
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.
Probably don't need to pass both order_form
and order
in, since order
can be found via order_form.object
.
If the goal is to make the code in the form partial nicer, it would be better to just store order
as a local there.
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 mean to have this in _form:
<% order = order_form.object %>
?
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.
Updated
51d2db1
to
91688d9
Compare
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.
Thanks
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.
Thanks
* Use ruby 1.9 hash style * Don't use @ instance variable in partial * Replace `order_form.object` with `order` * Replace `render :partial => '...', :locals => { ... }` with `render '...', { ... }`
91688d9
to
caca97e
Compare
Resolved merge conflicts with |
Thank you |
order_form.object
withorder
render :partial => '...', :locals => { ... }
with
render '...', { ... }