fix for forum topic response
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -3,4 +3,3 @@
|
||||
<%= render "forum_posts/forum_post", :forum_post => forum_post %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
<%= render "forum_posts/listing", :forum_posts => @forum_posts %>
|
||||
|
||||
<p><%= link_to "Reply »".html_safe, new_forum_post_path(:topic_id => @forum_topic.id) %></p>
|
||||
|
||||
<%= numbered_paginator(@forum_posts) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user