trabajo-afectivo/app/controllers/http_logs_controller.rb

24 lines
651 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
2016-04-18 00:02:31 +00:00
class HttpLogsController < ApplicationController
prepend_before_action :authentication_check
2016-04-18 00:02:31 +00:00
# GET /http_logs/:facility
def index
permission_check('admin.*')
2016-04-18 00:02:31 +00:00
list = if params[:facility]
HttpLog.where(facility: params[:facility]).order('created_at DESC').limit(params[:limit] || 50)
else
HttpLog.order('created_at DESC').limit(params[:limit] || 50)
end
model_index_render_result(list)
end
# POST /http_logs
def create
permission_check('admin.*')
2016-04-18 00:02:31 +00:00
model_create_render(HttpLog, params)
end
end