parsley/app/views/ingredients/index.html.erb

47 lines
1.2 KiB
Plaintext
Raw Normal View History

2016-01-12 18:43:00 -06:00
<div class="row">
<div class="col-xs-12">
2016-01-14 15:22:15 -06:00
<div class="page-header">
2016-01-18 12:58:54 -06:00
<h1>Ingredients</h1>
2016-01-14 15:22:15 -06:00
</div>
2016-01-12 18:43:00 -06:00
<% if @ingredients.empty? %>
<p>No Ingredients</p>
<% else %>
2016-01-12 18:43:00 -06:00
2016-01-30 17:02:19 -06:00
<table class="table table-condensed table-hover">
<thead>
2016-01-12 18:43:00 -06:00
<tr>
<th>Name</th>
2016-01-30 17:02:19 -06:00
<th>USDA NDBN</th>
<th>KCal per 100g</th>
<th>Density</th>
2016-01-30 17:02:19 -06:00
<th></th>
2016-01-12 18:43:00 -06:00
</tr>
</thead>
2016-01-12 18:43:00 -06:00
<tbody>
<% @ingredients.each do |ingredient| %>
<tr>
<td><%= link_to ingredient.name, edit_ingredient_path(ingredient) %></td>
2016-01-30 17:02:19 -06:00
<td><%= ingredient.ndbn %></td>
<td><%= ingredient.kcal %></td>
<td><%= ingredient.density %></td>
2016-01-30 17:02:19 -06:00
<td>
<%= link_to ingredient, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
2016-01-12 18:43:00 -06:00
<br/>
<%= link_to 'New Ingredient', new_ingredient_path, class: 'btn btn-default' %>
2016-01-12 18:43:00 -06:00
</div>
</div>