use named scopes, read a bit about them, lets you chain them like this
Home.ranged(6..9).paginate( etc etc)
On Tue, Sep 7, 2010 at 6:42 PM, Mark Moore
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> I am Using will_paginate plugin in a call like :
>
> @homes = Home.paginate(:all, :conditions => conditions....
>
> I want to have minimum and maximum price within all @homes searched. How
> would I do that efficiently?
> Since I do pagination, the @homes variable doesn''t contain all the
> "homes" objects, but only partial ones for pagination. Do I have
to do
> another query with same conditions without pagination to get it?
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.