<p>I'm wanting a method called same_url? that will return true if the passed in URLs are equal. The passed in URLs might be either params options hash or strings.</p>

<pre><code>same_url?({:controller =&gt; :foo, :action =&gt; :bar}, "http://www.example.com/foo/bar") # =&gt; true
</code></pre>

<p>The Rails Framework helper <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001607" rel="nofollow noreferrer">current_page?</a> seems like a good starting point but I'd like to pass in an arbitrary number of URLs.</p>

<p>As an added bonus It would be good if a hash of params to exclude from the comparison could be passed in. So a method call might look like:</p>

<pre><code>same_url?(projects_path(:page =&gt; 2), "projects?page=3", :excluding =&gt; :page) # =&gt; true 
</code></pre>

Is this the sort of thing you're after?
```
```
def same_url?(one, two)
  url_for(one) == url_for(two)
end
```
```