我有一个食谱、成分、成分_食谱模型
食谱有
has_many :ingredient_recipes
has_many :Ingredients, :through => :RecipeIngredient
成分有
has_many :ingredient_recipes
has_many :Recipes, :through => :RecipeIngredient
成分_配方有
belongs_to :recipes
belongs_to :ingredients
在我的用户界面中,这不再起作用
<% @recipe.ingredients.each do |ingredient| %>
编辑
ActionView::Template::Error (uninitialized constant Recipe::Ingredients):
97: </td>
98: <tr>
99: <td >
100: <% @recipe.ingredients.each do |ingredient| %>
101: ingredient.name
102: <% end %>
103: </td >