i have a table called reply which has id, name, addressi wanna retrieve address when a given name, so can anyone tell how can i do it. i can retrieve data using modelname.find(anyid),,but i can''t do it for any name --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ModelName.find_by_name(''some_name''). I have a doubt with your table it should be replies rather than reply coz'' table name are plural form of model name in ROR (if you stick with convention over configuration). On Nov 1, 9:47 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i have a table called reply which has id, name, addressi wanna retrieve > address when a given name, so can anyone > tell how can i do it. > i can retrieve data using modelname.find(anyid),,but i can''t > do it for any name--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
oh thanx,it was a mistake,il try ur code 2008/11/1 mrbless <mrbless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > ModelName.find_by_name(''some_name''). > I have a doubt with your table it should be replies rather than reply > coz'' table name are plural form of model name in ROR (if you stick > with convention over configuration). > > On Nov 1, 9:47 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > i have a table called reply which has id, name, addressi wanna retrieve > > address when a given name, so can anyone > > tell how can i do it. > > i can retrieve data using modelname.find(anyid),,but i can''t > > do it for any name > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
i tried it but iv got this errorNoMethodError in Agent replyController#show undefined method `find_by_name'' for #<Class:0x3bf8210> 2008/11/1 Ishara Gunathilake <jaimgunathilake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> oh thanx,it was a mistake,il try ur code > > 2008/11/1 mrbless <mrbless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > >> ModelName.find_by_name(''some_name''). >> I have a doubt with your table it should be replies rather than reply >> coz'' table name are plural form of model name in ROR (if you stick >> with convention over configuration). >> >> On Nov 1, 9:47 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > i have a table called reply which has id, name, addressi wanna retrieve >> > address when a given name, so can anyone >> > tell how can i do it. >> > i can retrieve data using modelname.find(anyid),,but i can''t >> > do it for any name >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
it was success,thankx 2008/11/1 Ishara Gunathilake <jaimgunathilake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> i tried it but iv got this errorNoMethodError in Agent > replyController#show > > undefined method `find_by_name'' for #<Class:0x3bf8210> > > > 2008/11/1 Ishara Gunathilake <jaimgunathilake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > oh thanx,it was a mistake,il try ur code >> >> 2008/11/1 mrbless <mrbless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> >>> ModelName.find_by_name(''some_name''). >>> I have a doubt with your table it should be replies rather than reply >>> coz'' table name are plural form of model name in ROR (if you stick >>> with convention over configuration). >>> >>> On Nov 1, 9:47 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>> > i have a table called reply which has id, name, addressi wanna retrieve >>> > address when a given name, so can anyone >>> > tell how can i do it. >>> > i can retrieve data using modelname.find(anyid),,but i can''t >>> > do it for any name >>> >>> >>> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Why don''t you try it out from your console. And if it work from there than you should have some problem in your controller. plz try it out from your console and let me know. On Nov 1, 10:04 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it was success,thankx > > 2008/11/1 Ishara Gunathilake <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > i tried it but iv got this errorNoMethodError in Agent > > replyController#show > > > undefined method `find_by_name'' for #<Class:0x3bf8210> > > > 2008/11/1 Ishara Gunathilake <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > oh thanx,it was a mistake,il try ur code > > >> 2008/11/1 mrbless <mrbl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > >>> ModelName.find_by_name(''some_name''). > >>> I have a doubt with your table it should be replies rather than reply > >>> coz'' table name are plural form of model name in ROR (if you stick > >>> with convention over configuration). > > >>> On Nov 1, 9:47 am, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >>> wrote: > >>> > i have a table called reply which has id, name, addressi wanna retrieve > >>> > address when a given name, so can anyone > >>> > tell how can i do it. > >>> > i can retrieve data using modelname.find(anyid),,but i can''t > >>> > do it for any name--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---