parsley/app/views/recipes/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">
<h1>Listing Recipes</h1>
<% if @recipes.empty? %>
<p>No Recipes</p>
<% else %>
<table>
<thead>
<tr>
<th>Name</th>
<th>Yields</th>
<th>Total Time</th>
<th>Active Time</th>
<th>Created</th>
<th>Modified</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @recipes.each do |recipe| %>
<tr>
<td><%= recipe.name %></td>
<td><%= recipe.yields %></td>
<td><%= recipe.total_time %></td>
<td><%= recipe.active_time %></td>
<td><%= recipe.created_at %></td>
<td><%= recipe.updated_at %></td>
<td><%= link_to 'Show', recipe %></td>
<td><%= link_to 'Edit', edit_recipe_path(recipe) %></td>
<td><%= link_to 'Destroy', recipe, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<br>
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %>
</div>
</div>