title: Best way to handle 404 in Rails3 controllers with a DataMapper get
body: <p>It's very simple, I want to handle a normal [show] request with a call to DataMapper like I did in Merb.</p>
  
  <p>With ActiveRecord I could have done this:</p>
  
  <pre><code>class PostsController
    def show
      @post = Post.get(params[:id])
      @comments = @post.comments unless @post.nil?
    end
  end
  </code></pre>
  
  <p>and it handles the 404 by catching the resource's exceptions.</p>
  
  <p>DataMapper instead doesn't do this automatically so right now I'm solving it with this solution:
  [moved in the answers]</p>
  
  <p>It is possible to tell the controller to halt inside the not_found function?</p>