理由:
# edit.html.erb
<%= form_for @product do |f| %>
<%= f.fields_for :shop do |sf| %>
# Nothing here
<% end %>
<% end %>
非表示の入力フィールドを生成します。
<input type="hidden" value="23" name="product[shop_attributes][id]" id="product_shop_attributes_id">
?
関連するコントローラ コード:
def edit
@product = Product.find(params[:id])
end