Pregunta

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.

¿Fue útil?

Solución

It is mising the each method call,

<% PaperTrail::Version.order('id desc').each do |v| %>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top