修改forum的show界面

This commit is contained in:
fanqiang 2013-11-23 20:31:48 +08:00
parent a4d4dd5d97
commit 17cb97828d
3 changed files with 6 additions and 16 deletions

View File

@ -18,7 +18,9 @@ class ForumsController < ApplicationController
@memos = @forum.topics @memos = @forum.topics
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html {
render :layout => 'base_forums'
}# show.html.erb
format.json { render json: @forum } format.json { render json: @forum }
end end
end end

View File

@ -11,17 +11,5 @@
<%= link_to 'Edit', edit_forum_path(@forum) %> | <%= link_to 'Edit', edit_forum_path(@forum) %> |
<%= link_to 'Back', forums_path %> <%= link_to 'Back', forums_path %>
<%= link_to 'new_topic', new_forum_memo_path(@forum) %> <%= link_to 'new_topic', new_forum_memo_path(@forum) %>
<table>
<tr> <%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>
<th>subject</th>
<th>content</th>
<th>author</th>
</tr>
<% @memos.each do |memo| %>
<tr>
<td><%= link_to memo.subject, forum_memo_path(memo) %></td>
<td><%= memo.content %></td>
<td><%= memo.author %></td>
</tr>
<% end %>
</table>

View File

@ -1,5 +1,5 @@
<h1>New memo</h1> <h1>New memo</h1>
<%= render 'form' %> <%= render :partial => 'form' %>
<%= link_to 'Back', forums_path(@forum) %> <%= link_to 'Back', forums_path(@forum) %>