<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -499,7 +499,7 @@ module ActionView
       # True if the current request URI was generated by the given +options+.
       #
       # ==== Examples
-      # Let's say we're in the &lt;tt&gt;/shop/checkout&lt;/tt&gt; action.
+      # Let's say we're in the &lt;tt&gt;/shop/checkout?order=desc&lt;/tt&gt; action.
       #
       #   current_page?(:action =&gt; 'process')
       #   # =&gt; false
@@ -507,6 +507,9 @@ module ActionView
       #   current_page?(:controller =&gt; 'shop', :action =&gt; 'checkout')
       #   # =&gt; true
       #
+      #   current_page?(:controller =&gt; 'shop', :action =&gt; 'checkout', :order =&gt; 'asc)
+      #   # =&gt; false
+      #
       #   current_page?(:action =&gt; 'checkout')
       #   # =&gt; true
       #
@@ -515,10 +518,18 @@ module ActionView
       def current_page?(options)
         url_string = CGI.escapeHTML(url_for(options))
         request = @controller.request
+        # We ignore any extra parameters in the request_uri if the 
+        # submitted url doesn't have any either.  This lets the function
+        # work with things like ?order=asc 
+        if url_string.index(&quot;?&quot;)
+          request_uri = request.request_uri
+        else
+          request_uri = request.request_uri.split('?').first
+        end
         if url_string =~ /^\w+:\/\//
-          url_string == &quot;#{request.protocol}#{request.host_with_port}#{request.request_uri}&quot;
+          url_string == &quot;#{request.protocol}#{request.host_with_port}#{request_uri}&quot;
         else
-          url_string == request.request_uri
+          url_string == request_uri
         end
       end
 </diff>
      <filename>actionpack/lib/action_view/helpers/url_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -258,6 +258,16 @@ class UrlHelperTest &lt; ActionView::TestCase
     assert_equal &quot;Showing&quot;, link_to_unless_current(&quot;Showing&quot;, { :action =&gt; &quot;show&quot;, :controller =&gt; &quot;weblog&quot; })
     assert_equal &quot;Showing&quot;, link_to_unless_current(&quot;Showing&quot;, &quot;http://www.example.com/weblog/show&quot;)
 
+    @controller.request = RequestMock.new(&quot;http://www.example.com/weblog/show?order=desc&quot;)
+    @controller.url = &quot;http://www.example.com/weblog/show&quot;
+    assert_equal &quot;Showing&quot;, link_to_unless_current(&quot;Showing&quot;, { :action =&gt; &quot;show&quot;, :controller =&gt; &quot;weblog&quot; })
+    assert_equal &quot;Showing&quot;, link_to_unless_current(&quot;Showing&quot;, &quot;http://www.example.com/weblog/show&quot;)
+
+    @controller.request = RequestMock.new(&quot;http://www.example.com/weblog/show?order=desc&quot;)
+    @controller.url = &quot;http://www.example.com/weblog/show?order=asc&quot;
+    assert_equal &quot;&lt;a href=\&quot;http://www.example.com/weblog/show?order=asc\&quot;&gt;Showing&lt;/a&gt;&quot;, link_to_unless_current(&quot;Showing&quot;, { :action =&gt; &quot;show&quot;, :controller =&gt; &quot;weblog&quot; })
+    assert_equal &quot;&lt;a href=\&quot;http://www.example.com/weblog/show?order=asc\&quot;&gt;Showing&lt;/a&gt;&quot;, link_to_unless_current(&quot;Showing&quot;, &quot;http://www.example.com/weblog/show?order=asc&quot;)
+
     @controller.request = RequestMock.new(&quot;http://www.example.com/weblog/show&quot;)
     @controller.url = &quot;http://www.example.com/weblog/list&quot;
     assert_equal &quot;&lt;a href=\&quot;http://www.example.com/weblog/list\&quot;&gt;Listing&lt;/a&gt;&quot;,</diff>
      <filename>actionpack/test/template/url_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2c7abe1b5682d287b19dde5900087908c976109c</id>
    </parent>
  </parents>
  <author>
    <name>Erik Andrejko</name>
    <email>eandrejko@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/ef9b6b5cba08f13dcbf7095226b78aaf22df13f7</url>
  <id>ef9b6b5cba08f13dcbf7095226b78aaf22df13f7</id>
  <committed-date>2008-10-26T11:14:45-07:00</committed-date>
  <authored-date>2008-10-26T09:46:17-07:00</authored-date>
  <message>modified current_page? to ignore extra parameters unless specified in options

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;
[#805 state:committed]</message>
  <tree>d9b332eba71925ceb524fbf638369bafe19d8786</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
