I have the following form in my Rails app:
<%= simple_form_for(@ingredient) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
...
<%= f.hidden_field :recipe, value: @recipe.id %>
</div>
<div class="form-actions text-center">
<%= f.button :submit %>
</div>
<% end %>
I have this in my controller:
@recipe = Recipe.find(params[:id])
@ingredient = Ingredient.new
@ingredients = Ingredient.where(user_id: current_user.id, recipe_id: @recipe.id)
And I have tested with byebug that @recipe.id comes out as a number (4 in the instance I am testing).
When the form actually gets rendered, the value is correct:

However, when the record is create the ingredient still is created with a recipe_id of nil. Any wisdom as to what's going wrong?
.form-inputsdiv, just below that selected hidden inputf.hidden_field :recipeshould bef.hidden_field :recipe_id