eBooru/app/controllers/post_events_controller.rb

17 lines
420 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
class PostEventsController < ApplicationController
2019-11-26 17:03:43 -05:00
respond_to :html, :json
def index
@events = PostEventDecorator.decorate_collection(
PostEvent.includes(:creator).search(search_params).paginate(params[:page], limit: params[:limit])
)
2022-01-08 19:47:06 -05:00
respond_with(@events) do |format|
format.json do
render json: Draper.undecorate(@events)
end
end
end
end