Hi everybody! Since theres not much documentation for awasome_nested_set , acts_as_commentable etc , im trying to build the
nested comments in easy way :
event.rb
…
has_many :comments
…
comment.rb
…
belongs_to :event
…
the following method saves the comment:
def post_comment @comment = Comment.new(
“event_id” => flash[:event_id], # yes, i store it in flash
“created_at” => Time.now,
“comment” => params[:comment][‘comment’],
“commenter” => current_user.login
)
if @comment.save
…
what i want to do is add “parent_id” column to comments table, add
“parent_id =>…” to post_comment. Then display a ‘Reply’ link under
each comment. The problem is i have no idea how to pass parent_id while
replying comment
the comments are displayed by the partial :
<%=comment.commenter.capitalize%> says: <%= h comment.comment
%>
I added some comments with parent_id manually to comments table, now i
need the way to change my partial to display all the child comment for
each parent comment.
i would really appreciate any suggestions/ideas . Thanks!
Hi everybody! Since theres not much documentation for awasome_nested_set , acts_as_commentable etc , im trying to build the
nested comments in easy way :
Bad idea. Go with awesome_nested_set . I don’t know why people keep
saying it’s poorly documented – although the Github pages don’t say
much, the rdoc is very clear.
Hi everybody! Since theres not much documentation for awasome_nested_set , acts_as_commentable etc , im trying to build the
nested comments in easy way :
Bad idea. Go with awesome_nested_set . I don’t know why people keep
saying it’s poorly documented – although the Github pages don’t say
much, the rdoc is very clear.