あるインデックス ページから別のインデックス ページにレコード (タイトル) を表示したい。
index.haml:-
-if @individual.important_event.present?
-@individual.important_event.each do |event|
%p
= link_to event.title, important_events_path
individual.rb:-
has_many :important_event
important_event.rb:-
belongs_to :individual
しかし、うまくいきません。「 #< ImportantEvent:0xbb729c8> に対して未定義のメソッド `each'」というエラーが表示されます。