Hi I have One Problem For Example if You Take Category has_many :products Here For Category i have soap as example for products i am taking Santoor , Lux and Rin soaps as products. Here Again Both Lux and santoor comes under Bathing soaps. Rin Soaps Comes under Washing Soaps So these are sub categories... Tom-arrow some new sub category may come like baby soaps.. I am confusing How many models i need ? how to define relation between them? But Finally We need To Access Data of 1]Total Soaps 2]Bathing Soaps 3]Washing Soaps ....... Whatever it may be uniquely.... How to define relation any one help me please................ Thank in Advance........ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Curtis Schofield
2011-Mar-02 16:12 UTC
Re: Designing Relation Ship Between Different Models
Sent from my iPad On Mar 1, 2011, at 10:16 PM, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi > > I have One Problem > > For Example if You Take > > Category has_many :products > > Here For Category i have soap as example > > for products i am taking Santoor , Lux and Rin soaps as products. >Product -name : string -has many :categories through :categorical Categorical -name: string -belongs to : member This is pseudo code - look in this direction> Here Again > > Both Lux and santoor comes under Bathing soaps. > Rin Soaps Comes under Washing Soaps > So these are sub categories... > > Tom-arrow some new sub category may come like baby soaps.. > > I am confusing How many models i need ? how to define relation between > them? > > But Finally > > We need To Access Data of > > 1]Total Soaps > 2]Bathing Soaps > 3]Washing Soaps > ....... > Whatever it may be uniquely.... > How to define relation any one help me please................ > > > Thank in Advance........ > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Looking for a wireless phone... wifi ortraditional wireless ?
- tests Rin Rout
- dovecot v2.3.0: imap segfault when sieve_extprograms_plugin.so called
- Re: dovecot v2.3.0: imap segfault when sieve_extprograms_plugin.so called
- segfault caused by `icfit` in `interval` package