Skip to content

Instantly share code, notes, and snippets.

@regonn
Created November 6, 2013 10:57
Show Gist options
  • Save regonn/7334238 to your computer and use it in GitHub Desktop.
Save regonn/7334238 to your computer and use it in GitHub Desktop.
<h1>Listing items</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Description</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @items.each do |item| %>
<tr>
<td><%= item.name %></td>
<td><%= item.price %></td>
<td><%= item.description %></td>
<td><%= link_to 'Show', item %></td>
<td><%= link_to 'Edit', edit_item_path(item) %></td>
<td><%= link_to 'Destroy', item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Item', new_item_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment