title: Rails 4.2 - dependent: :restrict_with_error - access errors
body: <blockquote>
    <p>:restrict_with_error causes an error to be added to the owner if there is an associated object
    <a href="http://guides.rubyonrails.org/association_basics.html" rel="noreferrer">rails association basics</a></p>
  </blockquote>
  
  <p>I have added the following to my code:</p>
  
  <pre><code>class Owner &lt; ActiveRecord::Base
    has_many :things, dependent: :restrict_with_error
  end
  </code></pre>
  
  <p>My understanding is when I try to delete an <strong>Owner</strong> that has dependent <strong>things</strong> then an error should be raised. In my show action in the <code>owners_controller</code> I try to access the errors but can not find them:</p>
  
  <pre><code>def show
    @owner = Owner.find(params[:id])
    @owner.errors
  end
  </code></pre>
  
  <p><strong>UPDATE - Delete Code</strong></p>
  
  <pre><code>def destroy
    @owner = Owner.find(params[:id])
    @owner.destroy
    flash[:notice] = "Owner Deleted Successfully"
    respond_with(@owner)
  end
  </code></pre>