[Rails] Re: "Selecting" a calculated row / Using :select in the pagi

Kevin Olbrich
Fri, 06 Jan 2006 02:03:26 -0000

Iv?n Vega Rivera wrote:
> @story_pages, @stories = paginate :stories, {:per_page => 10, :include
> => ''user'', :select => ''timediff(now(),
story.created_on) as story_age''}
>
> ... to no avail.

I''m somewhat sure that paginate (and find for that matter)
don''t know
what to do with the :select option.

Try using find_by_sql()

--
Posted via http://www.ruby-forum.com/.