Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% if user_signed_in? %>
- <p id="notice"><%= notice %></p>
- <h1>Posts</h1>
- <table>
- <thead>
- <tr>
- <th>Title</th>
- <th colspan="3"></th>
- </tr>
- </thead>
- <tbody>
- <% @posts.each do |post| %>
- <tr>
- <td><%= post.title %></td>
- <td><%= link_to 'Show', post %></td>
- <td><%= link_to 'Edit', edit_post_path(post) %></td>
- <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <br>
- <%= link_to 'New Post', new_post_path %>
- <% else %>
- <h1>hello, please sign in</h1>
- <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement