From fb40dca2daa521106f2ac4cb2a37c00491ab998d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Geonizeli?= Date: Sun, 27 Feb 2022 17:20:45 -0300 Subject: [PATCH] add user and fix quote_post reference on posts/index --- app/views/posts/_post.json.jbuilder | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/posts/_post.json.jbuilder b/app/views/posts/_post.json.jbuilder index 4aeaa5c..47cac0d 100644 --- a/app/views/posts/_post.json.jbuilder +++ b/app/views/posts/_post.json.jbuilder @@ -1,4 +1,6 @@ -json.extract! post, :id, :content, :user_id, :created_at, :updated_at -json.url post_url(post, format: :json) +json.extract! post, :id, :content, :created_at, :updated_at -json.quoted_post(post.quoted_post) \ No newline at end of file +json.quoted_post(post.quoted_post, partial: 'posts/post', as: :post) if post.quoted_post +json.user(post.user, partial: 'users/user', as: :user) if post.user + +json.url post_url(post, format: :json) \ No newline at end of file