Doubt in retrieving data to html?

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

Thank you i made small mistake but i got the output

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,1 ])

  @contract_name=[contract.name](http://contract.name)

  for getdata in @getdata  do       

    @agency_name=[getdata.name](http://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