<h1>Listing merchandises</h1>
-<table>
+<table border="1">
<tr>
- <th>Merchandise ID</th>
- <% for column in Merchandise.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
+ <th>Merchandise ID</th>
+ <th>Title</th>
+ <th>Quantity Remaining</th>
+ <th>Price Per Unit</th>
</tr>
<% for merchandise in @merchandises %>
<tr>
- <td><%=h merchandise.id %></td>
- <% for column in Merchandise.content_columns %>
- <td><%=h merchandise.send(column.name) %></td>
- <% end %>
- <td><%= link_to 'Show', :action => 'show', :id => merchandise %></td>
+ <td><%=h merchandise.id %></td>
+ <td><%=link_to merchandise.title.to_s, :action => 'show', :id => merchandise %></td>
+ <td><%=h merchandise.quantity %></td>
+ <td><%=h number_to_currency(merchandise.price) %></td>
<td><%= link_to 'Edit', :action => 'edit', :id => merchandise %></td>
- <td><%= link_to 'Destroy', { :action => 'destroy', :id => merchandise }, :confirm => 'Are you sure?', :method => :post %></td>
+ <td><%= link_to 'Remove', { :action => 'destroy', :id => merchandise }, :confirm => 'Are you sure?', :method => :post %></td>
</tr>
<% end %>
</table>