Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use page 1 in the params #229

Closed
wants to merge 1 commit into from

1 participant

@rhulse

When creating the pagination links, page 1 is not included for the links that go to page 1. This means that whatever is being paginated has to know that when no page param is set, it mean page one.

It is better form to explicitly set the page number all the time, ensuring that it will always work regardless of the underlying implementation.

@ghost

#222, We have the same thinking~

@rhulse

I'll close this and go and +1 yours! :-)

@rhulse rhulse closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2012
  1. @rhulse

    Use page 1 in the params

    rhulse authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/kaminari/helpers/tags.rb
View
2  lib/kaminari/helpers/tags.rb
@@ -25,7 +25,7 @@ def to_s(locals = {}) #:nodoc:
end
def page_url_for(page)
- @template.url_for @params.merge(@param_name => (page <= 1 ? nil : page))
+ @template.url_for @params.merge(@param_name => (page < 1 ? nil : page))
end
end
Something went wrong with that request. Please try again.