Skip to content

Instantly share code, notes, and snippets.

@baileylo
Created October 19, 2010 07:36
Show Gist options
  • Select an option

  • Save baileylo/633784 to your computer and use it in GitHub Desktop.

Select an option

Save baileylo/633784 to your computer and use it in GitHub Desktop.
Updates to the board show to display conversations in the board
<h1 id="page_title"><%= @board.title %></h1>
<p id="notice"><%= notice %></p>
<%= link_to 'Rails Boards', boards_path %> &gt; <%= link_to @board.title, @board %> <br />
<table>
<tr>
<th>Post / Author</th>
<th>Last Reply</th>
<th>Number of Replies</th>
</tr>
<% @board.conversations.each do |conversation| %>
<tr>
<td>
<%= link_to conversation.title, board_conversation_path(:board_id => @board, :id => conversation) %><br />
<%= conversation.user.username %>
</td>
<td>
<%= conversation.comments.find(:last).created_at %><br />
by <%= conversation.comments.find(:last).user.username %>
</td>
<td>
<%= conversation.comments.count - 1%>
</td>
</tr>
<% end %>
</table>
<%= link_to 'Post New Message', new_board_conversation_url(@board) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment