This project is archived and is in readonly mode.
current_page? in Rails 2.2.2 delivers wrong results
-
Steve Purcell
Hi Alexander,
The behaviour appears to be intentional: see the tests for #current_url.
I think the idea is that "current_page" considers two URLs to be the same page if they both refer to the same RESTful object (or set of objects), regardless of additional query parameters. So "/users?filter=x" is still the "user list" page, just as for "/users". Two different "pages" in this sense would therefore have different routes.
In your case, if you have conditional display logic depending on whether or not a filter is currently applied to the "/users" page, you should probably look at "request.params[:filter]" within the display code, or set a @filter variable in the controller, which you can then inspect in the view to decide what to do.
(Suggested resolution for this ticket: invalid / won't fix)
-
Steve St. Martin
- Assigned user set to Ryan Bigg
Agreed, rails is continues to focus more and more on RESTful design, this behavior is intended. Can be marked as wontfix