Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

variables_controller.rb 537 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
class Projects::VariablesController < Projects::ApplicationController
  before_action :authorize_admin_project!

  layout 'project_settings'

  def show
  end

  def update
10
    if project.update_attributes(project_params)
11
12
13
14
15
16
17
18
19
      redirect_to namespace_project_variables_path(project.namespace, project), notice: 'Variables were successfully updated.'
    else
      render action: 'show'
    end
  end

  private

  def project_params
20
    params.require(:project).permit({ variables_attributes: [:id, :key, :value, :_destroy] })
21
22
  end
end