Whats the recommended way of using the serializer when rendering json in a controller? Is one better than the other?
class PostsController < ApplicationController
def index
posts = Post.joins(:comments)
render json: PostSerializer.new(posts).serialized_json
render json: PostSerializer.new(posts).serializable_hash # OR
render json: PostSerializer.new(posts) # OR
end
end