Hey, I need help with a little something that I thought SHOULD work.
I’m getting this error:
ActionView::TemplateError (undefined method `find_by_person_and_event’
for Payment:Class) on line #2 of app/views/people/_attending.rhtml:
1: <% for event in @person.events %>
2: <% payment = Payment.find_by_person_and_event(@person,event) %>
3: Attending <%= event.name %>, as a <%= payment.price.name %>.
But here’s my Payment class, it looks correct:
class Payment < ActiveRecord::Base
has_many :person, :through => :attendance
has_many :event, :through => :attendance
Any ideas why those find_by methods simply are not working? Rails
never likes me when it comes to using them… I still haven’t figured
out the enigma.