【发布时间】:2012-06-09 21:47:30
【问题描述】:
我有一个食谱、成分、Ingredient_Recipe 模型
食谱有
has_many :ingredient_recipes
has_many :Ingredients, :through => :RecipeIngredient
成分有
has_many :ingredient_recipes
has_many :Recipes, :through => :RecipeIngredient
Ingredient_Recipe 有
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 >
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3