Alan Curtis wrote:> I would like to use the paginator helper to order by a quantity that is
> the product of two database columns.
>
> Is there a simple way to do this?
Someone will correct me if I''m wrong, but by using simple SQL you
should
be able to do...
:order => "(col1 * col2)"
I''m also assuming that by product you mean multiplication. You can of
course do any simple maths, or even other SQL queries in here.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---