On Tue, Aug 11, 2009 at 10:22 AM, karthik k <[email protected]> wrote:

>
>
> On Tue, Aug 11, 2009 at 10:18 AM, Marnen Laibow-Koser <
> [email protected]> 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
>> [email protected]
>> --
>> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to