Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- belongs_to :vegetable
- belongs_to :protein
- belongs_to :starch
- accepts_nested_attributes_for :vegetable, :protein, :starch
- has_one :recipe
- <table>
- <thead>
- <tr>
- <th> Vegetable Name </th>
- <th> Protein Name </th>
- </tr>
- </thead>
- <% @recipes.each do |recipes| %>
- <tr>
- <td> <% recipe.vegetable.name %> <td>
- <td> <% recipe.protein.name %> <td>
- </tr>
- def recipe_params
- params.require(:recipe).permit(:vegetable_id, :protein_id, :starch_id)
- end
Add Comment
Please, Sign In to add comment