Module: MuckCommentsHelper

Defined in:
app/helpers/muck_comments_helper.rb

Instance Method Summary collapse

Instance Method Details

#comment_form(parent, comment = nil) ⇒ Object

parent is the object to which the comments will be attached comment is the optional parent comment for the new comment.



5
6
7
# File 'app/helpers/muck_comments_helper.rb', line 5

def comment_form(parent, comment = nil)
  render :partial => 'comments/form', :locals => {:parent => parent, :comment => comment}
end

#make_parent_params(parent) ⇒ Object



13
14
15
# File 'app/helpers/muck_comments_helper.rb', line 13

def make_parent_params(parent)
  { :parent_id => parent.id, :parent_type => parent.class.to_s }
end

#new_comment_path_with_parent(parent) ⇒ Object



9
10
11
# File 'app/helpers/muck_comments_helper.rb', line 9

def new_comment_path_with_parent(parent)
  comments_path(make_parent_params(parent))
end