Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1346] Rescue from non-numeric page parameter exceptions #1432

Merged

Conversation

garethrees
Copy link
Member

Fixes #1346

will_paginate intentionally throws an ArgumentError when a non-numeric page
parameter is used. Conveniently, they tag it with WillPaginate::InvalidPage,
so here we rescue with a 404.

will_paginate intentionally throws an ArgumentError when a non-numeric page
parameter is used. Conveniently, they tag it with WillPaginate::InvalidPage,
so here we rescue with a 404.
@crowbot
Copy link
Member

crowbot commented Apr 14, 2014

Nice clean fix. 👍

@garethrees
Copy link
Member Author

Thnx! Took me a while to figure out their tagged exceptions. Quite a nice way of using them though.

@mysociety-pusher mysociety-pusher merged commit b0fbe64 into rails-3-develop Apr 14, 2014
@mysociety-pusher mysociety-pusher deleted the issues/1346-pagination-params-error branch April 14, 2014 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants