add user and fix quote_post reference on posts/index

This commit is contained in:
João Victor Geonizeli
2022-02-27 17:20:45 -03:00
parent 7a24f7950b
commit fb40dca2da

View File

@@ -1,4 +1,6 @@
json.extract! post, :id, :content, :user_id, :created_at, :updated_at json.extract! post, :id, :content, :created_at, :updated_at
json.url post_url(post, format: :json)
json.quoted_post(post.quoted_post) 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)