Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from enricostano/_list.html.erb
Created August 29, 2012 16:21
Show Gist options
  • Select an option

  • Save radar/3515156 to your computer and use it in GitHub Desktop.

Select an option

Save radar/3515156 to your computer and use it in GitHub Desktop.
<% @orders.each do |order| %>
<% if order.authorized %>
<tr class="order_authorized">
<% else %>
<tr>
<% end %>
<td><%= link_to order.user.email, user_path(order.user) %></td>
<td><%= link_to order.id, order_path(order) %></td>
<td><%= order.created_at.strftime("%d %B %Y") %></td>
<td><%= number_to_currency(order.line_items.sum(:price), :unit => "€") %></td>
<td><%= link_to 'Show', order %></td>
<td><%= link_to 'Edit', edit_order_path(order) %></td>
<td><%= link_to 'Destroy', order, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment