On Mon, Aug 10, 2009 at 11:07 AM, Kayne <[email protected]> wrote:
>
> Hi,
>
> I've got big problem. I was looking google for some info, but
> unfortunately, no solutions help me.
> So, my problem is:
>
> I've got this code:
>
> @pages, specs = paginate :specs,
> :conditions => ["last_name like ?", @initial+'%'],
> :order => "last_name, first_name",
> :per_page => 30
> @users = specs.collect { |spec| spec.user }
>
> 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:
>
> require 'will_paginate'
>
> And at least I'm looking...
>
> Crash. Error like this:
>
> NoMethodError in CommunityController#index
>
> undefined method `paginate' for #<CommunityController:0x49985b4>
>
> And now, I don't know what to do. Any solutions?
>
Kayne, you have a couple of choices:
1) Use the will_paginate gem here:
http://github.com/mislav/will_paginate/tree/master
and
follow the notes here:
http://blog.railsspace.com/past/2008/1/31/railsspace_will_paginate/
2) Use the class_pagination plugin here:
http://github.com/masterkain/classic_pagination/tree/master
Personally, I would recommend option (1) being that it works better for
moving search functionality into the model.
Good luck,
-Conrad
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---