trabajo-afectivo/app/controllers/http_logs_controller.rb

22 lines
605 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
2016-04-18 00:02:31 +00:00
class HttpLogsController < ApplicationController
prepend_before_action { authentication_check && authorize! }
2016-04-18 00:02:31 +00:00
# GET /http_logs/:facility
def index
list = if params[:facility]
HttpLog.where(facility: params[:facility]).order(created_at: :desc).limit(params[:limit] || 50)
2016-04-18 00:02:31 +00:00
else
HttpLog.order(created_at: :desc).limit(params[:limit] || 50)
2016-04-18 00:02:31 +00:00
end
model_index_render_result(list)
end
# POST /http_logs
def create
model_create_render(HttpLog, params)
end
end