Shiv N Gautam wrote: > On Fri, Sep 5, 2008 at 8:47 PM, Martyn Elmy-liddiard < > [EMAIL PROTECTED]> wrote: > >> @changes = Change.find_by_sql(["SELECT * FROM changes c where c.risk_id >> = ? order by c.id", @risks.id]) > > > How many records are there in the @risks object. You're doing > c.risk_id=@ > risks.id, so if there are multiple rows in @risks then the query wont > return > any result. > > >> end >> >> Any help please. >> >> Many thanks. >> -- >> Posted via http://www.ruby-forum.com/. >> >> > Shiv,
The @risks object will have multiple risks. What I am trying to do is for each risk I select I print the risk details then go and get any changes records associted with that risk record and print them then go round again for the next risk. Can you advise the syntax I would need to use to achieve this. Much appreciated Martyn >> > ~~ > Shiv N Gautam -- 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 -~----------~----~----~----~------~----~------~--~---

