Hi,
I am not sure that I follow everything you say but I think that if you
have the following:
class Feedback < ActiveRecord::Base
has_many :user
end
class User < ActiveRecord::Base
belongs_to :feedback
has_many :ads
end
class Ads < ActiveRecord::Base
belongs_to :user
end
Then you should be able to do something like
ads.user.feedback
to get the user feedback off of an ads object.
Disclaimer: I am rather new to all of this myself, so I could be
wrong...
Eric
Eddie wrote:> Hi. Please help guide me.
>
> In my model ''ads''..there''s a column for
''user_id''..
>
> In the user model, there''s is a column for
''feedback_id''..
>
> i''d like for my ads to display the user,
> and the feedback score from the feedback model..
>
> so should i include in my ''ads'' model a column for
''feedback_id'' too? or
> is ''user_id'' enough, and i''ll do a :through...
>
> (i''m not even sure if it''s possible if :through can work
like that. It''d
> be cool if it did..)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---