title: In Rails, How can I convert params[:id] to Integer
body: <p>Guys I am trying to retrieve specific records from the DB using <code>params[:id]</code>. </p>
  
  <pre><code> x = Authors.find(params[:id])
  </code></pre>
  
  <p>We cannot use <strong>FIND</strong> with string like this because the parameter is always passed by <strong>HTTP</strong> as a string:</p>
  
  <p>I also tried this code but I do not know why it always returns <strong>0</strong> while the passed parameter is <strong>4</strong></p>
  
  <pre><code> x = Authors.find(params[:id]).to_i 
  </code></pre>
  
  <p>So how can I do something like <strong>casting for ID Parameter</strong> or Any method to convert HTTP passed <strong>strings to integers</strong></p>