Every repository with this icon (
Every repository with this icon (
| Description: | Adaptive pagination plugin for web frameworks and other applications edit |
-
3 comments Created 4 months ago by fozzerequire 'facets' extends Fixnum with a 'length' method causing wp_count to return an incorrect countbugxIn finder.rb, in the wp_count method, there is a condition at the bottom of the method that checks
for whether the count responds to a length method. The popular facets gem breaks this. Perhaps, it might would be better to use is_a? instead of respond_to?check finder.rb, line 238
Comments
-
1 comment Created 4 months ago by johngrimesRemoving next link causes last page to repeatbugxThere seems to be a problem when you remove the next link by setting the next_link parameter to nil on the will_paginate method.
It seems to result in the link for the last page being repeated.
For example:
« Previous 1 2 2Comments
-
Reported by Ron Valente with mislav-will_paginate v2.3.11
466992 rows in set (0.97 sec)
>> h = Host.paginate :per_page => 15, :page => 1SystemStackError: stack level too deep
Ruby Versions - Same Error On Both
1. ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
2. ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9]Comments
Hey Ron,
First of all, check if you have some old version of will_paginate installed:
gem search will_paginateIf there is an old version, you can either uninstall it or make sure that your application loads the correct version by following the instructions in the wiki.
Next, tell me what version of Rails (or ActiveRecord, for that matter) are you using.
Third: does this happen with other tables that aren't so huge?
-
Finder.wp_count remove need group by option so returns invalid value
1 comment Created 2 months ago by ZenCocoonHi,
Here is the requests generated and showing the issue :
Author Load (1.3ms) SELECT
users., COUNT(1) AS count FROMusersINNER JOINpostsONposts.author_id =users.id WHERE ( (users.type= 'Author' ) ) GROUP BYposts.author_id LIMIT 2, 2 SQL (0.2ms) SELECT count() AS count_all FROMusersINNER JOINpostsONposts.author_id =users.id WHERE ( (users.type= 'Author' ) )In this case the GROUP BY as been removed but should have been kept to return the right number of results.
Comments
-
Finder.wp_count use invalid select option and breaks counting request
1 comment Created 2 months ago by ZenCocoonHi,
Here we go with the second issue regarding the counting request :
SELECT count(
users.*,addresses.full_address) AS count_users_all_addresses_full_address FROM ...This case actually breaks.
Looks like the select option could have been replaced to produce the following request and work as expected :SELECT COUNT(1) AS count_all FROM ...
Right now I work around this issue using the :count option of paginate but doesn't feel natural.
Let me know if you need further details.P.S. : a BIG thanks for this wonderful gem.
Comments
-
Hello mislav,
Is fully I18n support in todo list of will_paginate?
I'm using will_paginate with in some sites which needs to be internationalized.
Thanks
Comments
Yes, I18n is definitely planned. Thanks for requesting. Until the next major release you can copy-paste the
page_entries_infomethod in your own helpers and re-define it with internationalized strings. As forwill_paginatehelper, you can translate previous/next links by the use of option parameters.Thanks for response mislav. I will do it, thanks again.
jamesarosen
Sun Sep 27 12:08:12 -0700 2009
| link
-
:page parameter problem in the method paginate
0 comments Created 26 days ago by bcaccinoloHi,
The paginate method defaults to 1 the parameter :page if this one is false or nil. This parameter can also be an empty string. It could be good to defaults :page to 1 also in this case. We encountered this problem when our site is crawled by google bots.Here is my patch to this bug
http://gist.github.com/218537Comments
-
0 comments Created 17 days ago by slepafrikapage_entries_info with :per_page => 1todoxfirst of all thanks for sharing this great stuff. I am using this, amongst others, to skip through a stock of input forms of the same type. That means I am showing only 1 item per page and the user is able to jump or skip through the whole stock. To improve the visualisation I had to change your code of "page_entries_info" like that:
if collection.length == 1 %{Displaying #{entry_name} <b>%d</b> of <b>%d</b> in total} % [ collection.offset + 1, collection.total_entries ] else %{Displaying #{entry_name.pluralize} <b>%d - %d</b> of <b>%d</b> in total} % [ collection.offset + 1, collection.offset + collection.length, collection.total_entries ] endMaybe you like to change this as well for others.
Comments
-
0 comments Created 16 days ago by adamjmurrayentry name underscores in page_entries_infobugxThe default entry_name logic works better if you change the sub() call to gsub(). Then it handles classes with multiple underscores gracefully.
entry_name = options[:entry_name] || (collection.empty?? 'entry' : collection.first.class.name.underscore.gsub('_', ' '))Comments
-
Since will_paginate's method_missing takes control over any method that starts with the word "paginate", any custom methods that start with that word will not be found with respond_to?
A work around for now is to rename the method to not use the word "paginate" in the front.
http://github.com/enriquez/will_paginate/commit/26e5cf73f37338a8b7c78abddaccc22910d839ff
Comments












having the same issue myself...
Hi folks. Lemme know how this patch works for you:
http://github.com/jingoro/will_paginate/commit/627054b3f648417bb045702d2eb709ee0b34c492
jingoro,
Thanks for patching up the problem. It works just fine.
fozze