-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AMEND: Adds step+ingredients display partial
- Loading branch information
1 parent
9fa40f0
commit 5b3eed4
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<li class="preparation_step list-unstyled"> | ||
|
||
<% if step.has_measurements? %> | ||
<ul class="list-unstyled text-muted"> | ||
<% step.measurements.each do |measurement| %> | ||
<li class="ingredients_line"><%= measurement.amount %> <%= link_to measurement.ingredient.name, ingredient_path(measurement.ingredient) %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<%= step.directions %> | ||
<% if recipe.owner?(session[:user_id]) && params[:recipe_id].nil? %> | ||
<ul class="list-unstyled"> | ||
<li> | ||
<%= link_to "Edit Step", edit_recipe_step_path(recipe, step), class: "btn btn-default" %> | ||
</li> | ||
<li> | ||
<%= button_to "Delete Step", recipe_step_path(recipe, step), | ||
method: :delete, data: { confirm: "Are you 100% sure you want to delete this step? The associated ingredients will also be removed from the recipe!" }, | ||
class: "btn btn-danger" %> | ||
</li> | ||
</ul> | ||
<% end %> | ||
|
||
</li> |