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.

有帮助吗?

解决方案

It is mising the each method call,

<% PaperTrail::Version.order('id desc').each do |v| %>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top