Skip to main content

How do I make commentable comments available on the index page?

General • Asked by Thomas Connolly

I've got the polymorphic comments working on the two show pages, but I want to show all my posts (and reports) along with their comments on the two respective index pages. I can't seem to get it.

I should be able to delete this post, but don't see where it's possible.

Did you get it working? I wasn't around for the holidays for a bit.

I believe you can eager load the comments through the association in the index query and then just use the association to render them out on the index page. Is that what you ended up doing?

Yes, thank you. Now I am working on ajaxifying the comments. Anything I should watch out for?

Nothing really. It's pretty straightforward. You just want to use remote: true on the form and add the JS response to the action like you normally would. That's about it!

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.