will_paginate helper doesn't work with has_and_belongs_to_many associations.
-
Mislav
- Assigned user changed from Chris Wanstrath to Mislav
- State changed from new to open
- Tag set to will_paginate
Hey,
You didn't assign the ticket to me or tagged it "will_paginate", so I missed it. Has this been resolved for you in the meantime? If not, can you please provide more detail
Thanks
-
Ivan
Hey, I'm having the same problem, with the following model:
class Playlist < ActiveRecord::Base has_and_belongs_to_many :songs end
When I call @songs = Playlist.find(123).songs.paginate(:page => '1', :per_page => '20') The @songs variable is set with 20 songs, but when calling @songs.total_entries and total_pages, the result is 0. That's strange...
-
Mislav
- State changed from open to invalid
This is because of a bug in ActiveRecord with Ruby 1.8.7.
I've investigated and it looks like ruby 1.8.7 + ActiveRecord 2.1.1 = FAIL
It's been fixed in Rails commit 44af2e.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.