ROR paper_trial display all changes

325 views Asked by At

Hi I'm pretty new to rails, and brand new to paper_trail.

I'm trying to display a simple table of all changes made from the versions table and display in a view

    <table class="table">
    <tr>
        <th>Type</th>
        <th>Modified at</th>
    </tr>       
    <% PaperTrail::Version.order('id desc') do |v| %>
        <tr> 
            <td> <%= v.item_type.underscore.humanize %> </td>
            <td> <%= v.created_at.to_s %></td>
        </tr>       
    <% end %>       
</table>

unfortunately this renders the table headers but not the table body, any insight would be appreciated.

1

There are 1 answers

0
fotanus On BEST ANSWER

It is mising the each method call,

<% PaperTrail::Version.order('id desc').each do |v| %>