title: How to extract URL parameters from a URL with Ruby or Rails?
body: <p>I have some URLs, like</p>
  
  <pre><code>http://www.example.com/something?param1=value1&amp;param2=value2&amp;param3=value3
  </code></pre>
  
  <p>and I would like to extract the parameters from these URLs and get them in a Hash. Obviously, I could use regular expressions, but I was just wondering if there was easier ways to do that with Ruby or Rails. I haven't found anything in the Ruby module <code>URI</code> but perhaps I missed something.</p>
  
  <p>In fact, I need a method that would do that:</p>
  
  <pre><code>extract_parameters_from_url("http://www.example.com/something?param1=value1&amp;param2=value2&amp;param3=value3")
  #=&gt; {:param1 =&gt; 'value1', :param2 =&gt; 'value2', :param3 =&gt; 'value3'}
  </code></pre>
  
  <p>Would you have some advices?</p>