Sha256: 198935632d225d7e62d8f4568cdafb3bceebd17687024993255123ff2fbc0c19

Contents?: true

Size: 1.22 KB

Versions: 41

Compression:

Stored size: 1.22 KB

Contents

<h1><%= @title.pluralize %></h1>

<section>
    <% unless @records.empty? %>
        <table>
            <% @records.each do |record| %>
                <tr>
                    <td>
                        <a href="<%= url_prefix %>admin/<%= @plural %>/<%= record.id %>"><%= record.name %></a>
                    </td>
                    <td>
                        <% if !record.respond_to?(:can_delete?) || record.can_delete? %>
                            <form class="delete-row" action="<%= url_prefix %>admin/<%= @plural %>/<%= record.id %>" method="POST">
                                <input type="hidden" name="_method" value="DELETE">
                                <input type="submit" value="Delete">
                            </form>
                        <% end %>
                    </td>
                </tr>
            <% end %>
        </table>
    <% else %>
        <p>No <%= @plural %></p>
    <% end %>
</section>

<p class="actions"><a href="<%= url_prefix %>admin/<%= @plural %>/new">New <%= @title.downcase %></a></p>

<script>
    $('form.delete-row').submit(function(event) {
        if (!confirm('Are you sure you want to delete this <%= @singular %>?'))
            event.preventDefault();
    });
</script>

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
perus-0.1.23 lib/perus/server/views/admin/index.erb
perus-0.1.22 lib/perus/server/views/admin/index.erb
perus-0.1.21 lib/perus/server/views/admin/index.erb
perus-0.1.20 lib/perus/server/views/admin/index.erb
perus-0.1.19 lib/perus/server/views/admin/index.erb
perus-0.1.18 lib/perus/server/views/admin/index.erb
perus-0.1.17 lib/perus/server/views/admin/index.erb
perus-0.1.16 lib/perus/server/views/admin/index.erb
perus-0.1.15 lib/perus/server/views/admin/index.erb
perus-0.1.14 lib/perus/server/views/admin/index.erb
perus-0.1.13 lib/perus/server/views/admin/index.erb
perus-0.1.12 lib/perus/server/views/admin/index.erb
perus-0.1.11 lib/perus/server/views/admin/index.erb
perus-0.1.10 lib/perus/server/views/admin/index.erb
perus-0.1.9 lib/perus/server/views/admin/index.erb
perus-0.1.8 lib/perus/server/views/admin/index.erb
perus-0.1.7 lib/perus/server/views/admin/index.erb
perus-0.1.6 lib/perus/server/views/admin/index.erb
perus-0.1.5 lib/perus/server/views/admin/index.erb
perus-0.1.4 lib/perus/server/views/admin/index.erb