On Sun, Apr 10, 2011 at 10:23 PM, Ad Ber <[email protected]> wrote:
> Todd A. Jacobs wrote in post #992052: > > On Apr 10, 7:42pm, Ad Ber <[email protected]> wrote: > >> @p = Pay.find_by_sql("SELECT p.id, p.topic, s.id, s.income, s.price > FROM > >> pays as P LEFT OUTER JOIN suggests AS s ON s.b_id = p.b_id WHERE > >> p.created_at BETWEEN '2008-03-04' AND '2008-07-06' ") > >> > > [snip] > >> <%= form.message %><br /> > >> It gives me an error missing attribute > > > > Perhaps because you aren't selecting a message attribute in your SQL > > statement? > > > > Uhm..sorry that is an typo error.. > > what i means was > > In my View action or method: > > <%= @p.each do |form| %> > > <%= form.topic%><br /> > <%= form.income %><br /> (error on this part) > > <% end %> > > Im having an error on the form.income part.. > > If you have relationships setup between your models then getting to the income should be a easy as form.suggest.income or form.suggests.first.income depending on the relationship type. B. -- 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.

