Hello there, im kind of a newbie with ruby on rails and i have a question about has_many and belongs_to because i saw tutorials where they use it but i don''t see how it works ? What if you don''t use it ? In fact i don''t see if it is actually usefull... Please give me some light =) --~--~---------~--~----~------------~-------~--~----~ 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 18 Nov 2008, at 12:51, BoBKilla wrote:> > Hello there, > im kind of a newbie with ruby on rails and i have a question about > has_many and belongs_to because i saw tutorials where they use it but > i don''t see how it works ? What if you don''t use it ? > In fact i don''t see if it is actually usefull... >Well associations are pretty fundamental to Active Record. You don''t have to use them but you''d just be creating a lot of work for yourself and missing out on a lot of the handy bits in rails. http://guides.rails.info/association_basics.html is probably not a bad place to start. Fred> Please give me some light =) > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
has_many / belongs_to is how you tell Rails that models are related... Start reading here: http://api.rubyonrails.org/ Look at the ActiveRecord::Base entry to begin your instruction Grasshopper... -- 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 -~----------~----~----~----~------~----~------~--~---
thanks, now i see why it is usefull to use it ! On 18 nov, 15:03, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 18 Nov 2008, at 12:51, BoBKilla wrote: > > > > > Hello there, > > im kind of a newbie with ruby on rails and i have a question about > > has_many and belongs_to because i saw tutorials where they use it but > > i don''t see how it works ? What if you don''t use it ? > > In fact i don''t see if it is actually usefull... > > Well associations are pretty fundamental to Active Record. You don''t > have to use them but you''d just be creating a lot of work for yourself > and missing out on a lot of the handy bits in rails.http://guides.rails.info/association_basics.htmlis probably not a bad > place to start. > > Fred > > > Please give me some light =)--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---