hi I have a controller def showagencies @getdata=Agency.all(:joins=>:contracts, :select=>"agencies.*",:conditions=>["contract_id in (?) and agencies.status =?",contracts.id,1 ]) end @getdata is not visible in html its lenght is o but has some contents plz let me know how to access this -- Karthik.k Mobile - +91-9894991640 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Karthik Kantharaj wrote: [...]> @getdata is not visible in html its lenght is o but has some contentsLooks like @getdata contains an array. (And by the way, that''s a terrible variable name -- use something more descriptive.)> > plz let me know how to access thisIterate over the @getdata array and generate appropriate HTML for each element.> > > > -- > Karthik.k > Mobile - +91-9894991640Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
On Tue, Aug 11, 2009 at 10:18 AM, Marnen Laibow-Koser < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Karthik Kantharaj wrote: > [...] > > @getdata is not visible in html its lenght is o but has some contents > > Looks like @getdata contains an array. (And by the way, that''s a > terrible variable name -- use something more descriptive.) > > > > > plz let me know how to access this > > Iterate over the @getdata array and generate appropriate HTML for each > element..Thank you i made small mistake but i got the output -- Karthik.k Mobile - +91-9894991640> > > > > > > > > > -- > > Karthik.k > > Mobile - +91-9894991640 > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Aug 11, 2009 at 10:22 AM, karthik k <cse.k.karthik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tue, Aug 11, 2009 at 10:18 AM, Marnen Laibow-Koser < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> >> Karthik Kantharaj wrote: >> [...] >> > @getdata is not visible in html its lenght is o but has some contents >> >> Looks like @getdata contains an array. (And by the way, that''s a >> terrible variable name -- use something more descriptive.) >> >> > >> > plz let me know how to access this >> >> Iterate over the @getdata array and generate appropriate HTML for each >> element.. > > > Thank you > i made small mistake > but i got the output > > -- > Karthik.k > Mobile - +91-9894991640 >Hi i have another doubt for the below code def showagencies @contracts=Contract.find(:all,:conditions=>[''status=?'',1]) for contract in @contracts do @agency=Agency.all(:joins=>:contracts, :select=>"agencies.*",:conditions=>["contract_id in (?) and agencies.status =?",contract.id <http://contracts.id/>,1 ]) @contract_name=contract.name for getdata in @getdata do @agency_name=getdata.name end end end now as you can see @contract_name will have many agencies so i have another for loop and getting @agency_name so my out put will be e.g contract1 agency1 agency2 contract2 agency1 agency2 now can i take @contract_name and @agency_name and display like the above output in html if my approach is wrong plz guide me -- Karthik.k Mobile - +91-9894991640> > > > >> >> >> > >> > >> > >> > -- >> > Karthik.k >> > Mobile - +91-9894991640 >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >> -- >> 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 -~----------~----~----~----~------~----~------~--~---