You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/messages/_list.json.jbuilder

9 lines
304 B

6 years ago
json.replies do
json.array! messages do |message|
arr = message.children.preload_messages.by_user(@current_user)
json.total_count arr.size
json.partial! "messages/message_detail", message: message
json.partial! 'messages/list', messages: arr.ordered(sort: 1).limit(5)
end
end