<div class="app"> <% @posts.each do |p| %> <div class="forum"> <%= "Subject: #{p.topic.subject}" %><br/> <%= "Author: #{p.user.login}" %><br/> <%= "Posted: #{ftime p.created_at}" %><br /> <hr /> <%= format_post p.data %> <br /><hr /> <%= link_to 'reply', {:action => 'postreply', :id => p.id} %> <% if owner?(p.user_id) %> <%= link_to 'edit', {:action => 'postedit', :id => p.id} %> <% end %> <% if admin? %> <%= link_to 'delete', {:action => 'postdelete', :id => p.id} %> <% end %> </div> <% end %> </div>