fix for forum topic response

This commit is contained in:
albert
2013-01-24 14:37:39 -05:00
parent e0c563373a
commit 2f9db2399c
4 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ class ForumPostsController < ApplicationController
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@forum_topic = ForumTopic.find(params[:topic_id]) if params[:topic_id]
@forum_post = ForumPost.new_reply(params)
respond_with(@forum_post)
end

View File

@@ -3,4 +3,3 @@
<%= render "forum_posts/forum_post", :forum_post => forum_post %>
<% end %>
</div>

View File

@@ -1,6 +1,11 @@
<div id="c-forum-topics">
<div id="a-new">
<h1>New Forum Post</h1>
<% if @forum_topic %>
<h1>Reply to <%= @forum_topic.title %></h1>
<% else %>
<h1>New Forum Post</h1>
<% end %>
<%= render "form" %>
<%= error_messages_for "forum_post" %>
</div>

View File

@@ -15,6 +15,8 @@
<%= render "forum_posts/listing", :forum_posts => @forum_posts %>
<p><%= link_to "Reply &raquo;".html_safe, new_forum_post_path(:topic_id => @forum_topic.id) %></p>
<%= numbered_paginator(@forum_posts) %>
</div>
</div>