gaurav bagga
2006-Aug-22 06:47 UTC
[Rails] Re: where I''m wrong? (has_and_belongs_to_many)
@program.ProgramSpecificCategories when you say this it means that there is a method by that name i.e def ProgramSpecificCategories #..... end but here thats not the case so what you want to put inside the instance variables of @program try to fill in those data i.e the columns of the underlying table what i think you want to do from the code it seems On 8/22/06, rosoft2001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rosoft2001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > seems to help a little, but still an error: > > "undefined method `ProgramSpecificCategories'' " > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Max Muermann
2006-Aug-22 21:43 UTC
[Rails] Re: where I''m wrong? (has_and_belongs_to_many)
More under_scores: @program.ProgramSpecificCategories << @psc should be @program.program_specific_categories << @psc and in your migration: t.column :programspecificcategory_id, :integer, :limit =>11 should be t.column :program_specific_category_id, :integer, :limit =>11 In Rails, the naming convention is that *only* class names are upeer/camel cased. Everything else (and I mean everything) is snake_cased, including table names, column names, methods names and field names. Cheers, Max On 8/22/06, gaurav bagga <gaurav.v.bagga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > @program.ProgramSpecificCategories > > when you say this it means that there is a method by that name > > i.e def ProgramSpecificCategories > #..... > end > > but here thats not the case so what you want to put inside the instance > variables of @program try to fill in those data i.e the columns of the > underlying table > > what i think you want to do from the code it seems > > > > On 8/22/06, rosoft2001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rosoft2001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > seems to help a little, but still an error: > > > > "undefined method `ProgramSpecificCategories'' " > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rosoft2001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Aug-22 23:15 UTC
[Rails] Re: where I''m wrong? (has_and_belongs_to_many)
YES! it works, thank you. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---