Doc new_comment_form
This commit is contained in:
parent
2fb0fce1a8
commit
71dbfce23f
1 changed files with 4 additions and 0 deletions
|
|
@ -13,6 +13,10 @@ module CommentsHelper
|
||||||
str
|
str
|
||||||
end
|
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)
|
def new_comment_form(post_id, current_user)
|
||||||
@form ||= controller.render_to_string(
|
@form ||= controller.render_to_string(
|
||||||
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})
|
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue