docbrown/app/views/chat_channels/show.json.jbuilder
Michael Kohl 02d23a0673
Refactor jbuilder (#7411)
* Refactor jbuilder for articles

* Refactor remaining jbuilder files

* Fix specs

* Remove content_truncated from response template JSON

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-04-24 12:49:12 +02:00

15 lines
479 B
Ruby

json.messages @chat_messages.reverse do |message|
json.extract!(message, :id, :user_id, :edited_at)
json.username message.user.username
json.profile_image_url ProfileImage.new(message.user).get(width: 90)
json.message message.message_html
json.markdown message.message_markdown
json.timestamp message.created_at
json.color message.preferred_user_color
json.action message.chat_action
end
json.key_format! camelize: :lower
json.chat_channel_id @chat_channel.id