* 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>
15 lines
479 B
Ruby
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
|