1db53b8ae0b6cd45edcbf1a908b3dbc492abb82f
[depot.git] / app / views / products / index.html.erb
1 <div id="product-list">
2 <h1>Listing products</h1>
3
4 <table>
5 <% for product in @products %>
6 <tr class="<%= cycle('list-line-odd', 'list-line-even')%>">
7
8 <td>
9 <%= image_tag product.image_url, :class => 'list-image' %>
10 </td>
11
12 <td class="list-description">
13 <dl>
14 <dt><%= h product.title %></dt>
15 <dd><%= h truncate(product.description.gsub(/<.*?>/, ''),
16 :length => 80) %></dd>
17 </dl>
18 </td>
19
20 <td class="list-actions">
21 <%= link_to 'Show', product %><br/>
22 <%= link_to 'Edit', edit_product_path(product) %><br/>
23 <%= link_to 'Destroy', product,
24 :confirm => 'Are you sure?',
25 :method => :delete %>
26 </td>
27 </tr>
28 <% end %>
29 </table>
30 </div>
31
32 <br/>
33
34 <%= link_to 'New product', new_product_path %>