% has_ndbn = @ingredient.ndbn.present? %>
<%= form_for(@ingredient, html: {id: 'ingredient_form'}) do |f| %>
<%= render partial: 'shared/error_list', locals: {model: @ingredient} %>
<%= f.hidden_field :ndbn, class: 'ndbn' %>
<%= f.hidden_field :id, class: 'id', disabled: true %>
<%= f.label :name, class: 'control-label' %>
<%= f.text_field :name, class: 'form-control name', autofocus: true %>
<%= f.label :density, class: 'control-label' %>
<%= f.text_field :density, class: 'form-control', disabled: has_ndbn %>
<%= f.label :notes, class: 'control-label' %>
<%= f.text_area :notes, class: 'form-control' %>
<%= f.submit class: 'btn btn-primary' %>
<% end %>