On Wed, Jan 14, 2009 at 3:24 AM, Rails Terrorist < rails-mailing-l...@andreas-s.net> wrote:
> > James Bond wrote: > > I use will_paginate to get results: > > > > @results = Users.paginate(:all, :conditions => "... > > > > But how can I get a number of reults? > > to get a number of result you can get it by : > > @results.size > > if @results.size < 1 > flash[:notice] = "There's no result so its data is empty." > end > > > - Ruby Servant - > [Some times i am terrorist of it] > -- > Posted via http://www.ruby-forum.com/. > > > > @results.size will give you the number in that 'page' @results.total_entries will give you the total number of results you're paginating over -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---