How do I save and update attributes in a join table in Rails 4 HMT association?
I have a has_many through join table setup for a recipe app where Ingredient and Meal connect through MealIngredient . Within MealIngredient , I have meal_id , ingredient_id , and amount . My question is: How can I save and update the amount column in the meal form? My form field for adding an ingredient looks like this: <% Ingredient.all.each do |ingredient| %> <label> <%= check_box_tag "meal[ingredient_ids][]", ingredient.id, f.object.ingredients.include?(ingredient) %> <%= ingredient.name %> </label> <br /> <% end %> How do I save the amount for each ingredient? I am referencing this