Hi there,
I have a PostsController, not essential to the example but will help when I paste snippets, and I'm using current_page?
to, as the name implies, figure out what page is being displayed. I'm getting what seem like weird results.
current_page?
will return different answers if I go to /posts
vs. /posts/
.
As a test, on the index view for my controller I am simply calling
current_page?(:action => 'index')
If I go to /controller (with no trailing slash), current_page?
will return true. However, if I go to /controller/, it will return false.
Tailing the log shows that both do in fact hit the same action
Processing PostsController#index (for 127.0.0.1 at 2009-08-11 18:28:12) [GET]
Parameters: {"action"=>"index", "method"=>:get, "controller"=>"posts"}
The action produces the same results for both, as to be expected.
I'm using Rails 2.3.2 and this ticket is the only thing that seems close. The only commenter thinks that current_page should "consider two URLs to be the same page if they both refer to the same RESTful object".
Thanks for any insight into this.