Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
9 lines (8 sloc) 231 Bytes
json.(chatroom, :name, :id)
json.messages(chatroom.messages
.sort_by{|m| m[:created_at]}) do |message|
json.extract! message, :id, :body
json.user do
json.extract! message.user, :id, :name, :image
end
end