Voog.com

Comment

This is a representation of single comment associated with an article.

Availability of comments

Comments can be accessed through an article via {{ article.comments }}. This accessor method returns only comments that are in public state (e.g. not spam). Here is a simple example:

{% for comment in article.comments %}
  From: {{ comment.author }} at {{ comment.created_at | date: "%d.%m" }}
  {{ comment.body }}
{% endfor %}

Available properties

author

Returns the comment author's name.

author_email

Returns author email for comment.

body

Returns formatted body for comment.

created_at

Returns Time object representing comment creation time.

errors

Returns an array of possible validation errors. Useful when rendering a comment form.

valid?

Returns true if the comment has no validation errors.