# frozen_string_literal: true class Api::V3::Posts::CommentsController < Api::V3::ApiController include BetterRateLimitable before_action -> { rate_limit 60, 1.minute, 'You are submitting too many API requests!' } def index post = Post.find(params[:post_id]) authorize! :read, post render json: { comments: CommentSerializer.serialize_collection(post.comments.to_a) } end end