I'm trying to create a form\_for using the following fields. However, some of the fields correspond to one model, the RecipeIngredient class (model), whereas the bottom fields correspond to the Recipe class (model).

```
  <%= form_for(:recipe_and_ingredients, :url => {:action => 'create'}) do |f| %>

<!-- RecipeIngredient classs -->
<table>
<tr>
 <td>4</td>
 <td><%= f.text_field(:quantity) %></td>
 <td><%= f.text_field(:weight) %></td>
 <td><%= f.text_field(:units) %></td>
</tr>
</table> 

<!-- Recipe class -->
<table summary="Recipe form fields">
  <tr>
    <th>Recipe Name</th>
    <td><%= f.text_field(:recipe_name) %></td>
    <th>Total Grams</th>
    <td><%= f.text_field(:total_grams) %></td>
  </tr>
</table>

<div class="form-buttons">
  <%= submit_tag("Create Recipe") %>
</div>

<% end %>

```

However, in my controller:

```
 # Instantiate a new object using form parameters
  @recipe = Recipe.new(params[:recipe_and_ingredients])
  @ingredient = RecipeIngredient.new(params[:recipe_and_ingredients])

```

I get this error when I submit the form

```
  unknown attribute: quantity

```

I know this is because the Recipe model/class/table/whatever does not have a quantity column; that is a column within RecipeIngredient (which is supposed to be a join table between Recipe and some other table if that is relevant). When I submit the params however, how do I differentiate, in the code, which parameters belong to which class?