I call this method in my controller:
delete_heard_timeline_event(current_user.id, @showable_video.user.id, @showable_video.video.id)
and I definite it in my model:
def delete_heard_timeline_event(actor_id, subject_id, secondary_subject_id)
TimelineEvent.find_by_actor_id_and_subject_id_and_secondary_subject_id_and_event_type(actor_id, subject_id, secondary_subject_id, 'heard_event').destroy
end
Why is rails telling me that the method is undefined?
If you defined this method as
instancemethod so you need to to call it like this:and if this methods is
classmethod so call: