Hi i have two tables treatmentcategories and treatmentitems. each category has many items. i have specified has_many :treatmentitems in treatmentcategories.rb model and belongs_to :treatmentcategories in treatmentitems.rb model in one of my def i am trying to display category with each item. So i used @cats = Treatmentcategories.find(:all, :include => :treatmentitems) but i am getting following error: uninitialized constant Treatmentcategories::Treatmentitem output i am looking for is: cat1 item1 item2 cat2 item1 and so on please advice thanks in advance Ajit --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ajit wrote:> belongs_to :treatmentcategories in treatmentitems.rb modelShould be belongs_to :treatmentcategory -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---