Files
national-parks-api/app/controllers/api/v1/parks/alerts_controller.rb

15 lines
336 B
Ruby

module Api::V1::Parks
class AlertsController < BaseController
before_action :set_park
def index
render json: {
total: @park.alerts.count,
limit: pagination_limit,
offset: pagination_offset,
alerts: @park.alerts.limit(pagination_limit).offset(pagination_offset)
}
end
end
end