docbrown/app/controllers/api/v0/comments_controller.rb
cyrillefr 4fd66372dc Enable Layout/AlignParameters (#2340)
Check if the parameters on a multi-line method call or definition are aligned.

Resolves: #2021
2019-04-08 18:47:34 -04:00

25 lines
706 B
Ruby

module Api
module V0
class CommentsController < ApplicationController
# before_action :set_cache_control_headers, only: [:index, :show]
caches_action :index,
cache_path: proc { |c| c.params.permit! },
expires_in: 10.minutes
respond_to :json
caches_action :show,
cache_path: proc { |c| c.params.permit! },
expires_in: 10.minutes
respond_to :json
def index
@commentable = Article.find(params[:a_id]) # or not_found
@commentable_type = "Article"
end
def show
(@comment = Comment.find(params[:id].to_i(26))) || not_found
end
end
end
end