implemented forum post controller

This commit is contained in:
albert
2011-01-13 18:16:39 -05:00
parent 523cc9fe02
commit 541163685d
13 changed files with 121 additions and 42 deletions

View File

@@ -0,0 +1,7 @@
<div class="comments">
<div class="index">
<% @comments.each do |comment| %>
<%= render :partial => "comments/partials/index/list", :locals => {:post => comment.post, :comments => [comment], :show_header => false} %>
<% end %>
</div>
</div>

View File

@@ -0,0 +1,7 @@
<div>
<%= simple_form_for @search do |f| %>
<%= f.input :body_matches %>
<%= f.input :creator_name_equals %>
<%= f.button :submit %>
<% end %>
</div>

View File

@@ -0,0 +1,6 @@
<h1>Edit Post</h1>
<%= simple_form_for(@forum_post) do |f| %>
<%= f.input :body %>
<%= f.button :submit %>
<% end %>

View File

@@ -0,0 +1,26 @@
<%= render "search" %>
<table>
<thead>
<tr>
<th>Topic</th>
<th>Excerpt</th>
<th>Creator</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<% @forum_posts.each do |forum_post| %>
<tr>
<td><%= forum_post.topic.title %></td>
<td><%= truncate forum_post.body, :length => 50 %></td>
<td><%= forum_post.creator.name %></td>
<td><%= forum_post.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
<div id="paginator">
<%= will_paginate @forum_posts %>
</div>

View File

@@ -0,0 +1,7 @@
<h1>New Post</h1>
<%= simple_form_for(@forum_post) do |f| %>
<%= f.input :topic_id, :as => :hidden %>
<%= f.input :body %>
<%= f.button :submit %>
<% end %>