/app/views/posts/index.html.erb
Ruby HTML | 22 lines | 18 code | 4 blank | 0 comment | 1 complexity | 8b2d6e60f5898fec910b115697f90978 MD5 | raw file
1<h1>Listing blogs</h1> 2 3<table> 4 <tr> 5 <th>Title</th> 6 <th>Body</th> 7 </tr> 8 9<% for post in @posts %> 10 <tr> 11 <td><%=h post.title %></td> 12 <td><%=h post.body %></td> 13 <td><%= link_to 'Show', post %></td> 14 <td><%= link_to 'Edit', edit_post_path(post) %></td> 15 <td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td> 16 </tr> 17<% end %> 18</table> 19 20<br /> 21 22<%= link_to 'New blog', new_post_path %>