You can setup to display only number of comments setting associated_limit to 0, 
so no 
comment will be displayed and only the counter will be displayed.

To sort by comments count, you need to enable counter_cache in associations, 
adding 
comments_count column to posts table, then you can sort by comments_count column
conf.columns[:comments].sort_by :sql => ['posts.comments_count']

In this case, you can disable eager loading of comments, as you don't need to 
display 
size or sort:
conf.columns[:comments].includes = nil

El Viernes, 6 de noviembre de 2015 08:06:10 Mehmet BEYDOĞAN escribió:
> Hello,
> 
> I have a Post model and it has many Comments. I want to display number of
> comments of the posts and be able to order posts by comments count in post
> list that using active_scaffolded PostController.
> 
> How can I accomplish this? Couldn't find anything similiar in docs.

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to