Class: Admin::ExceptionLogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/admin/exception_logs_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#require_admin, #set_active_menu

Methods inherited from ApplicationController

#fresh_when, #redirect_back_or_default, #redirect_referrer_or_default, #render_403, #render_404, #render_optional_error_file, #require_user, #set_active_menu, #set_locale, #set_seo_meta, #store_location, #unread_notify_count

Instance Method Details

#cleanObject


21
22
23
24
25
# File 'app/controllers/admin/exception_logs_controller.rb', line 21

def clean
  ExceptionLog.delete_all

  redirect_to admin_exception_logs_path, notice: '清空成功。'
end

#destroyObject


27
28
29
30
# File 'app/controllers/admin/exception_logs_controller.rb', line 27

def destroy
  @exception_log = ExceptionLog.find(params[:id])
  @exception_log.destroy
end

#indexObject


3
4
5
6
7
8
9
10
# File 'app/controllers/admin/exception_logs_controller.rb', line 3

def index
  @exception_logs = ExceptionLog.order(id: :desc).paginate(page: params[:page], per_page: 20)

  respond_to do |format|
    format.html # index.html.erb
    format.json
  end
end

#showObject


12
13
14
15
16
17
18
19
# File 'app/controllers/admin/exception_logs_controller.rb', line 12

def show
  @exception_log = ExceptionLog.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.json
  end
end