I am new to rails and have to develop a small app which will do regular social networking. So, whats the best and efficient way to implement friends/friendship thing so that I could get complete list of every user''s friends with @user.friends and also which is easy to maintain and implement. Thanks. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Vapor .. wrote:> I am new to rails and have to develop a small app which will do regular > social networking. > So, whats the best and efficient way to implement friends/friendship > thing so that I could get complete list of every user''s friends with > @user.friends and also which is easy to maintain and implement. > > Thanks. >You''ll want to do a self referential ''has_many :through =>''. A google search with just the right keywords (eg: self referential has_many through) should get you all the information you need, and then some. Good Luck! And welcome to Rails. -- http://www.5valleys.com/ http://www.workingwithrails.com/person/8078 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Use the awesome plugin "has_many_friends": http://svn.dnite.org/has_many_friends/README -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Jon, Take a look at this plugin. http://www.railslodge.com/plugins/40-has-many-friends Jon Garvin wrote:> Vapor .. wrote: >> I am new to rails and have to develop a small app which will do regular >> social networking. >> So, whats the best and efficient way to implement friends/friendship >> thing so that I could get complete list of every user''s friends with >> @user.friends and also which is easy to maintain and implement.-- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Scott A S wrote:> Hi Jon, > > Take a look at this plugin. > http://www.railslodge.com/plugins/40-has-many-friendsactually I want to sort of understand it...I mean how it all actually works with has_many => :through -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
The post I liked the most is: http://www.fallenrogue.com/article/view/143-I-am-what-I-am-or-self-referential-joins-in-Rails AWDWR and Rails Recipes also help a lot. Cheers, Sazima On Feb 1, 3:15 am, "Vapor .." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Scott A S wrote: > > Hi Jon, > > > Take a look at this plugin. > >http://www.railslodge.com/plugins/40-has-many-friends > > actually I want to sort of understand it...I mean how it all actually > works with has_many => :through > -- > Posted viahttp://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?hl=en -~----------~----~----~----~------~----~------~--~---
Check out RailsSpace book on Amazon: http://www.amazon.com/RailsSpace-Building-Networking-Addison-Wesley-Professional/dp/0321480791/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1201892461&sr=1-1 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---