OK, I''m working on a simple site to share music created by users from a forum I belong to. I''m trying to make it so users can follow other users to keep track of what they''re up to (sort of like Twitter if you know how that works). Currently I''m working on the page that displays the users that follow a certain user, I can easily do the reverse of this (see what users a certain user is follow, user.friends) but I can''t do it the other way. Does Rails have a built-in method for this (I''ve searched the API docs, and the Agile Web Dev book with no luck)? Thanks, Tony --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 1, 10:10 pm, TeeC <starni...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, I''m working on a simple site to share music created by users from > a forum I belong to. I''m trying to make it so users can follow other > users to keep track of what they''re up to (sort of like Twitter if you > know how that works). > > Currently I''m working on the page that displays the users that follow > a certain user, I can easily do the reverse of this (see what users a > certain user is follow, user.friends) but I can''t do it the other way. >Don''t you just create another habtm which uses the same join table but with the :foreign_key and :associated_foreign_key options swapped round ? Fred> Does Rails have a built-in method for this (I''ve searched the API > docs, and the Agile Web Dev book with no luck)? > > Thanks, > Tony--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wow, that was surprisingly simple. Thanks, Tony On Sep 1, 5:34 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sep 1, 10:10 pm, TeeC <starni...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, I''m working on a simple site to share music created by users from > > a forum I belong to. I''m trying to make it so users can follow other > > users to keep track of what they''re up to (sort of like Twitter if you > > know how that works). > > > Currently I''m working on the page that displays the users that follow > > a certain user, I can easily do the reverse of this (see what users a > > certain user is follow, user.friends) but I can''t do it the other way. > > Don''t you just create another habtm which uses the same join table but > with the :foreign_key and :associated_foreign_key options swapped > round ? > > Fred > > > Does Rails have a built-in method for this (I''ve searched the API > > docs, and the Agile Web Dev book with no luck)? > > > Thanks, > > Tony--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---