But it doesn’t work properly. I think: It is normal, because of new
version of Rails (2.0 and higher), where paginate is plugin now. So i
installed will_paginate by this way:
gem install mislav-will_paginate
(gem install will_paginate doesn’t work too!)
And added on the end (after “end” word) in config/enviroment.rb:
Yes, but I didn’t understand this… I’m newb. I use now RailsSpace
book.
Will you so cool and translate to me: How can I change my code for
will_paginate, please?
RailsSpace is clearly outdated and that old “paginate” method should
not be used anymore. You’re better served getting a newer book like
the latest “Agile web development with Rails”.
And when I want to execute this code. browser gives me back:
Couldn’t find Spec with ID=1 AND (last_name like ‘B%’)
I don’t know, what exactly it’s saying… I just want to paginate rows
from model Spec (which one is belongs_to :user), to show users from
databases. In Spec model I’ve got first_name and last_name and by
ActiveRecord this is belong to User model.
But now I’ve got problem - how it show by will_paginate?
Yes, but I didn’t understand this… I’m newb. I use now RailsSpace
book.
Will you so cool and translate to me: How can I change my code for
will_paginate, please?
It’s pretty simple. Your models gain a paginate method that is pretty
much exactly the same as find (it takes the same options
(:conditions, :order and so on) except that it also takes a :page and
a :per_page option and loads only the relevant records.
And when I want to execute this code. browser gives me back:
Look at the will_paginate docs a little more closely. The paginate
method returns a single object and (unlike the old paginate) you don’t
pass it an argument to tell it what to paginate. That error message
doesn’t look like something that will_paginate would raise though.