Forum: Ruby on Rails Many to Many associations

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
51bb5688c8c2c1b68d03c56da8e0b696?d=identicon&s=25 Alfredo Gama (alfredogz)
on 2007-01-19 17:56

i have this:

class User < ActiveRecord::Base
  has_many :transfers
  has_many :camelids, :through => :transfers

class Camelid < ActiveRecord::Base
  has_many   :transfers
  has_many   :users, :through => :transfers

class Transfer < ActiveRecord::Base
  belongs_to :user
  belongs_to :camelid

how can i show a field from transfers in my view??
in the controler:
@camelids = User.find(, :conditions =>
["transfers.actual_owner=1"],:include=>[:camelids, :transfers]).camelids

in the view

camelid.transfers.transfer_at ??? but is shows an error : undefined
method `transfer_at' for Transfer:Class
This topic is locked and can not be replied to.