/app/views/posts/index.html.erb

http://scruptious-social-networking.googlecode.com/ · Ruby HTML · 22 lines · 18 code · 4 blank · 0 comment · 1 complexity · 8b2d6e60f5898fec910b115697f90978 MD5 · raw file

  1. <h1>Listing blogs</h1>
  2. <table>
  3. <tr>
  4. <th>Title</th>
  5. <th>Body</th>
  6. </tr>
  7. <% for post in @posts %>
  8. <tr>
  9. <td><%=h post.title %></td>
  10. <td><%=h post.body %></td>
  11. <td><%= link_to 'Show', post %></td>
  12. <td><%= link_to 'Edit', edit_post_path(post) %></td>
  13. <td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
  14. </tr>
  15. <% end %>
  16. </table>
  17. <br />
  18. <%= link_to 'New blog', new_post_path %>