From 71dbfce23f2cd685eaa5301c6f5a98c2c7fc7c3a Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sun, 10 Jul 2011 21:44:08 -0700 Subject: [PATCH] Doc new_comment_form --- app/helpers/comments_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 5f6821521..574f85996 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -13,6 +13,10 @@ module CommentsHelper str end + # This method memoizes the new comment form in order to avoid the overhead of rendering it on every post. + # @param [Integer] post_id The id of the post that this form should post to. + # @param [User] current_user + # @return [String] The HTML for the new comment form. def new_comment_form(post_id, current_user) @form ||= controller.render_to_string( :partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})