title: Rails: Proc in routes?
body: <p>I'm reading The Rails 3 Way and I don't understand why there's a proc in the routes. I still have a hard time grasping the use of proc/lambda and how they are used.</p>
  
  <p>How is this:</p>
  
  <pre><code>match 'records/:id' =&gt; "records#protected",
    :constraints =&gt; proc {|req| req.params[:id].to_i &lt; 100 }
  </code></pre>
  
  <p>different from:</p>
  
  <pre><code>match 'records/:id' =&gt; "records#protected",
    :constraints =&gt; params[:id].to_i &lt; 100
  </code></pre>
  
  <p>? </p>