2016-01-09 14:30:34 -05:00
|
|
|
class Admin::SpamLogsController < Admin::ApplicationController
|
|
|
|
def index
|
2016-01-26 16:20:01 -05:00
|
|
|
@spam_logs = SpamLog.order(id: :desc).page(params[:page])
|
2016-01-09 14:30:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
2016-01-26 16:20:01 -05:00
|
|
|
spam_log = SpamLog.find(params[:id])
|
2016-01-09 14:30:34 -05:00
|
|
|
|
|
|
|
if params[:remove_user]
|
2016-01-26 16:20:01 -05:00
|
|
|
spam_log.remove_user
|
|
|
|
redirect_to admin_spam_logs_path, notice: "User #{spam_log.user.username} was successfully removed."
|
|
|
|
else
|
|
|
|
spam_log.destroy
|
2016-03-15 21:16:25 -04:00
|
|
|
head :ok
|
2016-01-09 14:30:34 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|