Currently I have an each loop in the template for where the comments are display. Say a user has 50 comments to a micropost they have posted. A long list showing 50 comments will be displayed.
To save space on the page I’ve decided I’d like to limit comments shown to 2-3 per micropost. If a user wishes to view more they can click “view more” or “view all”. I’m wondering how a server would cope if there were like 10,000 comments and a user clicked “view all” which is why I may choose to implement “view more” then have like 50 more comments shown”
Anyway I’d like to know a good way to limit the amount of comments shown to a user until they choose to view all?
If I go the jquery/js route and make it so only the 2-3 most recent messages are shown the others would have still been loaded back end wouldn’t they so wouldn’t a better option be to control this in ruby on rails some how?
I’d really like some nice solutions/info on the best way to do this.
Any further info you need I’d be happy to provide.
Thanks
Kind regards
You can do like Facebook:
On Facebook, you can’t load more than 50 comments at once. I think you should do the same.