Skip to content

Instantly share code, notes, and snippets.

@ornerymoose
Created April 17, 2014 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ornerymoose/10995309 to your computer and use it in GitHub Desktop.
Save ornerymoose/10995309 to your computer and use it in GitHub Desktop.
cart partial as is in app/views/carts
<div class="cart_title">Your Cart</div>
<table>
<%= render(@cart.line_items) %>
<tr class="total_line">
<td colspan="2">Total</td>
<td class="total_cell"><%= number_to_currency(@cart.total_price) %></td>
</tr>
</table>
<%= button_to 'Empty cart', @cart, method: :delete, confirm: 'Are you sure?' %>
<%= link_to 'Checkout', new_charge_path(id: @cart.id) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment