title: How to handle error when ID is not found?
body: <p>What is the best way to handle the error then ID is not found?
  I have this code in my controller:</p>
  <pre><code>  def show
      @match = Match.find(params[:id])
    end
  </code></pre>
  <p>I was thinking about something like this:</p>
  <pre><code>  def show
      if @match = Match.find(params[:id])
      else
        render 'error'
      end
    end
  </code></pre>
  <p>But I still get:</p>
  <blockquote>
  <p>ActiveRecord::RecordNotFound in MatchesController#show</p>
  <p>Couldn't findMatch with 'id'=2</p>
  </blockquote>
  <p>Why?</p>
  <p>What is the correct solution?</p>