%= form_for(@recipe, {html: {class: 'recipe-form'}}) do |f| %>
<%= render partial: 'shared/error_list', locals: {model: @recipe} %>
<%= f.label :name %>
<%= f.text_field :name, class: 'form-control' %>
<%= f.label :description %>
<%= f.text_area :description, class: 'form-control' %>
<%= f.label :source %>
<%= f.text_field :source, class: 'form-control' %>
<%= f.label :yields %>
<%= f.number_field :yields, class: 'form-control', placeholder: 'Servings' %>
<%= f.label :total_time %>
<%= f.number_field :total_time, class: 'form-control', placeholder: 'Minutes' %>
<%= f.label :active_time %>
<%= f.number_field :active_time, class: 'form-control', placeholder: 'Minutes' %>
Ingredients
<%= f.fields_for :recipe_ingredients do |ri_form| %>
<%= render partial: 'recipes/editor/ingredient', locals: { f: ri_form } %>
<% end %>
<%= link_to_add_association 'Add Ingredient', f, :recipe_ingredients, partial: 'recipes/editor/ingredient', :'data-association-insertion-node' => '#ingredient-list', :'data-association-insertion-method' => 'append', class: 'btn btn-primary' %>
Steps
<%= f.fields_for :recipe_steps do |rs_form| %>
<%= render partial: 'recipes/editor/step', locals: { f: rs_form } %>
<% end %>
<%= link_to_add_association 'Add Step', f, :recipe_steps, partial: 'recipes/editor/step', :'data-association-insertion-node' => '#step-list', :'data-association-insertion-method' => 'append', class: 'btn btn-primary' %>
<%= f.submit class: 'btn btn-primary' %>
<% end %>