1
所以,我有评级未定义的方法或变量错误(Rails)的
class Rating < ActiveRecord::Base
attr_accessible :name
has_many :parties
end
与党,属于评级
class Party < ActiveRecord::Base
attr_accessible :name, :rating_id
belongs_to :rating
end
在show.html.erb的评价观点
<%= @rating.parties %>
显示属于该评级的所有参与方。
错误:
undefined method `parties'
我不知道为什么,如果我定义了党新型属于评级。在例子中看过类似的东西。
请发布**完整**错误消息。你确定'@ rating'不是零吗? – iblue 2013-02-26 22:49:31