elight / acts_as_commentable_with_threading

Similar to acts_as_commentable; however, utilizes awesome_nested_set to provide threaded comments
MIT License
671 stars 168 forks source link

Show last comments and link to resource #105

Closed edvasqueza closed 7 years ago

edvasqueza commented 7 years ago

Hello, I'm able to show the last comments by querying the comments table, but I want to show a link to the related resource of those comments. Is it possible? Thank you.

edvasqueza commented 7 years ago

If someone needs this, you can access to the commentable object by calling

comment.commentable

and then you can create a simple link_to

<%= link_to 'title', comment.commentable %>

It was pretty straightforward but I suggest adding it to the readme, the commentable object is never mentioned.