Sha256: 04de9bebb698a8d21b5d301e7ea7eade83909168afc9037f2c41376b6ae8d849

Contents?: true

Size: 508 Bytes

Versions: 7

Compression:

Stored size: 508 Bytes

Contents

module MuckCommentsHelper
  
  # parent is the object to which the comments will be attached
  # comment is the optional parent comment for the new comment.
  def comment_form(parent, comment = nil)
    render :partial => 'comments/form', :locals => {:parent => parent, :comment => comment}
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
muck-comments-0.1.1 app/helpers/muck_comments_helper.rb
muck-comments-0.1.2 app/helpers/muck_comments_helper.rb
muck-comments-0.1.3 app/helpers/muck_comments_helper.rb
muck-comments-0.1.4 app/helpers/muck_comments_helper.rb
muck-comments-0.1.5 app/helpers/muck_comments_helper.rb
muck-comments-0.1.6 app/helpers/muck_comments_helper.rb
muck-comments-0.1.0 app/helpers/muck_comments_helper.rb