Skip to content
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

Merged
merged 1 commit into from
Mar 14, 2017

Conversation

vfonic
Copy link
Contributor

@vfonic vfonic commented Feb 20, 2017

  • 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 '...', { ... }

Copy link
Contributor

@cbrunsdon cbrunsdon left a 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 %>
Copy link
Contributor

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.

Copy link
Contributor Author

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 %>

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@vfonic vfonic force-pushed the cart-form-code-styling branch from 51d2db1 to 91688d9 Compare February 23, 2017 02:39
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@jhawthorn jhawthorn left a 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 '...', { ... }`
@vfonic vfonic force-pushed the cart-form-code-styling branch from 91688d9 to caca97e Compare February 28, 2017 01:45
@vfonic
Copy link
Contributor Author

vfonic commented Feb 28, 2017

Resolved merge conflicts with master

@jhawthorn jhawthorn merged commit 9cc2f61 into solidusio:master Mar 14, 2017
@jhawthorn
Copy link
Contributor

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants