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