Skip to content

Instantly share code, notes, and snippets.

@dalizard
Created January 4, 2012 16:00
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 dalizard/1560678 to your computer and use it in GitHub Desktop.
Save dalizard/1560678 to your computer and use it in GitHub Desktop.
<%= form_for(@cart, @cart.line_items) do |f| %>
<ul data-role="listview" data-split-theme="a" data-split-icon="delete">
<% for item in @cart.line_items %>
<%= f.fields_for item, :index => item.id do |item_form| %>
<li>
<a href="#">
<%= image_tag item.image %>
<h1><%= item.model %></h1>
<dl>
<dt>Item #</dt>
<dd><%= item.sku %></dd>
<dt>Quantity</dt>
<dd><%= item_form.select(:quantity, 0..10) %></dd>
<dt>Price</dt>
<dd><%= number_to_currency(item.store_price) %></dd>
</dl></a>
<%= link_to "Delete Item", line_item_path(item.id), :method => :delete, 'data-ajax' => 'false' %>
</li>
<% end %>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment