title: Rails 4.0 record not found
body: <p>on my edit action I never rise the record not found if the record does not exist. What I'm doing wrong.</p>
  
  <p>Here is my edit action</p>
  
  <pre><code>    class OffersController &lt; ApplicationController
  
      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found        
  
      def show
          @offer = Offer.find(params[:id])
      end        
  
      def edit
          @offer = Offer.find_by(edit_hash: params[:edit_hash])
          @country = Country.find_by(name: @offer.country)
          @states = State.find(:all, :conditions =&gt; { country_id: @country })
      end
  
      private
  
          def record_not_found
              render text: "404 Not Found", status: 404
          end
      end 
  </code></pre>
  
  <p>I always get undefined method `country' for nil:NilClass for my unexist edit record.</p>
  
  <p>Also I raise the record not found on my show action, but I would like to use the 404.html page that I have on my public folder. How can I use this file???</p>
  
  <p>Thanks in advance</p>