module Comments::ViewHelpers

Public Instance Methods

comments_tag(commentable, opts = {}) click to toggle source
# File lib/comments/view_helpers.rb, line 8
def comments_tag(commentable, opts = {})
  comments = Comment.where(commentable: commentable).includes(:user).order("lft asc, id asc").page(params[:page])

  render partial: '/comments/comments', locals: { commentable: commentable, comments: comments }
end