Welcome to mirror list, hosted at ThFree Co, Russian Federation.

abuse_reports_controller.rb « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 757be5ef7270f85430158a7ccce70a083f774871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class AbuseReportsController < ApplicationController
  def new
    @abuse_report = AbuseReport.new
    @abuse_report.user_id = params[:user_id]
  end

  def create
    @abuse_report = AbuseReport.new(report_params)
    @abuse_report.reporter = current_user

    if @abuse_report.save
      redirect_to root_path, notice: 'Thank you for report. GitLab administrator will be able to see it'
    else
      render :new
    end
  end

  private

  def report_params
    params.require(:abuse_report).permit(:user_id, :message)
  end
end