title: Rails 3.2 error showing Audited changes in views
body: <p>I have a strange problem. My audited gem does not work in my views when i have this code in my contracten view:</p>
  
  <pre><code>&lt;p&gt;&lt;%= @contracten.respond_to?(:audits) %&gt;&lt;/p&gt;
  &lt;br /&gt;
  &lt;%= @contracten.audits.each do |audit| %&gt;
    &lt;%= audit.version %&gt;
    &lt;br /&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>it gives the following error: <code>undefined method</code>audits' for nil:NilClass`</p>
  
  <p>When i only have this line in my views:     <code>&lt;p&gt;&lt;%= @contracten.respond_to?(:audits) %&gt;&lt;/p&gt;</code>
  It showes false instead of true so i don't think my controller is working properly.</p>
  
  <p>My controller show:</p>
  
  <pre><code>  def show
      add_breadcrumb 'Contract Bekijken', :contracten_path
  
      @contracten = Contracten.find(params[:id])
    end
  </code></pre>
  
  <p>My model: </p>
  
  <pre><code>class Contracten &lt; ActiveRecord::Base
  
    audited
  
    has_attached_file :pdf
  
    attr_accessible :betalingsperiodeeenheidid, :betalingstermijn, :contractduur, :contractid, :contractsoortid, :datumeinde, :datumingang, :naam, :omschrijving, :opzegtermijn, :organisatieid, :persoonid, :vestigingid, :pdf
  
  end
  </code></pre>
  
  <hr>
  
  <p>I posted a similar question here: <a href="https://stackoverflow.com/questions/11289990/show-last-modified-tables-records-rails-3-2">Show Last modified tables/records Rails 3.2</a> but that's not specific about audited. i did not find a simplier gem for it so this may work. but i'm still struggling with the views</p>