Sha256: e27664b9c4484a8c2bde875d27f71d259ca9cce0dfbf5b6c2d63e477ff3cb3db

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

<p id="notice"><%= notice %></p>

<div>
  <h1>Posts</h1>

  <table>
    <thead>
      <tr>
        <th>ID</th>
        <th>Title</th>
        <th>State</th>
        <th>Members Only?</th>
        <th>Created</th>
        <th colspan="3"></th>
      </tr>
    </thead>

    <tbody>
      <% if @posts.exists? %>
        <% @posts.each do |post| %>
          <tr>
            <td><%= post.id %></td>
            <td><%= post.title %></td>
            <td><%= post.state %></td>
            <td><%= post.members_only %></td>
            <td><%= post.created_at.strftime("%m/%d/%y") %></td>
            <td><%= link_to 'Show', post %></td>

            <% if current_user.try(:admin?) %>
              <td><%= link_to 'Edit', edit_post_path(post) %></td>
              <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
            <% end %>
            
          </tr>
        <% end %>
      <% else %>
        <tr>
          <td>No Posts</td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <div id="pagination">
    <%= paginate @posts, views_prefix: 'picco_blog' %>
  </div>

  <br>

  <%= link_to 'New Post', new_post_path %>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picco_blog-1.4.3 app/views/picco_blog/posts/admin_list.html.erb
picco_blog-1.4.2 app/views/picco_blog/posts/admin_list.html.erb
picco_blog-1.4.1 app/views/picco_blog/posts/admin_list.html.erb