Class: Admin::SpamLogsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/spam_logs_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject


6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/admin/spam_logs_controller.rb', line 6

def destroy
  spam_log = SpamLog.find(params[:id])

  if params[:remove_user]
    spam_log.remove_user
    redirect_to admin_spam_logs_path, notice: "User #{spam_log.user.username} was successfully removed."
  else
    spam_log.destroy
    render nothing: true
  end
end

#indexObject


2
3
4
# File 'app/controllers/admin/spam_logs_controller.rb', line 2

def index
  @spam_logs = SpamLog.order(id: :desc).page(params[:page])
end