Displaying 1 result from an estimated 1 matches for "print_two_table".
2011 Apr 11
4
Printing field attributes outside the model.find_by_sql
Hi All,
I have Model called pays..and it has fields like(id, topic, subject,
created_at, b_id) and i also have a Model called suggests with
fields(id, income, price, b_id)
In my ruby on rails action or method Controller:
def print_two_table
@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'' ")
end
In my View action or method:
<%= @p.each do |form|...