search for: last_msg

Displaying 2 results from an estimated 2 matches for "last_msg".

Did you mean: last_kmsg
2005 Dec 29
4
Paginate do a Count(*) request before, how access that count value.
Hello, AV::paginate query first by a count, how access this value in the controller or view ? Why ? Because I''ll like to display the total number or records found w/o doing another expenssive Count. Thanks,
2005 Dec 29
1
Paginate do a Count(*) request before...
...t help you: http://wiki.rubyonrails.org/rails/pages/HowtoPagination To Adam, one tip about your solution. Once you have a Paginator object that the view can see, you can use its methods to get the number of items while in the view instead of having to set the variables @total, @first_msg, @last_msg in the controller. (Everyone has their own style but I like to keep my controller as streamlined as I can.) Just use something like this in your view: Listing <%= @message_pages.current.first_item %> - <%= @message_pages.current.last_item %> of <%= pluralize(@ message_pages.it...