Re: Paginate with Rails 2.0.2 question

Kyle
Thu, 10 Apr 2008 01:43:56 -0000

If you''re just wanting to follow AWDWR, just don''t use any
pagination.  You only add 4 items...

Instead of @post_pages, @posts = paginate :posts, :per_page => 10,
just do @posts = Post.find(:all)

If you need pagination, learn will_paginate (it works almost exactly
like ''find'').  If you''re just getting your feet wet,
focus on more
important things.  You can paginate when you have stuff that''s worth
paginating.  :)

-Kyle

On Apr 9, 1:24 am, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> On 9 Apr 2008, at 00:49, Fingal wrote:
>
>
>
> > I have, I think, gotten the gem.  The files "will_paginate"
and
> > "will_paginate.rb" exist in my vendor/plugins/will_paginate
> > directory.  I still get the "undefined method
''paginate''" message when
> > I try to load the page that''s supposed to use it.  Another
posting
> > somewhere else said I needed to add "require
''will_paginate''" to my
> > environment.rb, and I did that, with no change in the result.
I''m not
> > sure if it should be necessary, but I am restarting the server every
> > time I make a change.
>
> will_paginate is great but is not a drop-in replacement for what was
> in rails 1.2 (classic_pagination does that)
>
>
>
> > All I''m really trying to do is use AWDWR to learn about
Rails, and I
> > wasn''t bright enough to install the downrev Rails (the
previous layer
> > of the onion was "scaffold").  If uninstalling 2.0.2, and
installing
> > 1.something (what a pain) really is the only way to use AWDWR, I guess
> > I can, but this makes the whole business look pretty fragile, which I
> > thought was one of the main things RoR was *not* supposed to be.
>
> Trying to follow instructions written for a previous version of a
> framework/application is never going to be fun :-)
>
> Fred
>
> > On Mar 31, 8:07 am, fredistic
<fredis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> I found that converting to will_paginate to be so easy it confused
> >> me.  I was looking for more work to do and didn''t realize
I was done.
> >> There''s a railscast on it somewhere.
>
> >> F