[Rails] Re: Number of entries

2009-01-13 Thread Andrew Timberlake
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

[Rails] Re: Number of entries

2009-01-13 Thread Rails Terrorist
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."

[Rails] Re: Number of entries

2009-01-13 Thread Ryan Bigg
; >> x = @results.empty? ? 1 : 0 >> >> -Original Message- >> From: rubyonrails-talk@googlegroups.com >> [mailto:rubyonrails-talk@googlegroups.com >> ] On Behalf Of James Bond >> Sent: Tuesday, January 13, 2009 11:42 AM >> To: rubyonrails-talk@goo

[Rails] Re: Number of entries

2009-01-13 Thread MaurĂ­cio Linhares
t; x = @results.empty? ? 1 : 0 > > -Original Message- > From: rubyonrails-talk@googlegroups.com > [mailto:rubyonrails-t...@googlegroups.com] On Behalf Of James Bond > Sent: Tuesday, January 13, 2009 11:42 AM > To: rubyonrails-talk@googlegroups.com > Subject: [Rails]

[Rails] Re: Number of entries

2009-01-13 Thread Pardee, Roy
x = @results.empty? ? 1 : 0 -Original Message- From: rubyonrails-talk@googlegroups.com [mailto:rubyonrails-t...@googlegroups.com] On Behalf Of James Bond Sent: Tuesday, January 13, 2009 11:42 AM To: rubyonrails-talk@googlegroups.com Subject: [Rails] Re: Number of entries How can I

[Rails] Re: Number of entries

2009-01-13 Thread James Bond
How can I write it simple? if @results.empty? x = 0 else x = 1 end -- 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