gitlab-org--gitlab-foss/app/controllers/projects/variables_controller.rb

23 lines
537 B
Ruby
Raw Normal View History

class Projects::VariablesController < Projects::ApplicationController
before_action :authorize_admin_project!
layout 'project_settings'
def show
end
def update
2015-12-04 11:55:23 +00:00
if project.update_attributes(project_params)
redirect_to namespace_project_variables_path(project.namespace, project), notice: 'Variables were successfully updated.'
else
render action: 'show'
end
end
private
def project_params
params.require(:project).permit({ variables_attributes: [:id, :key, :value, :_destroy] })
end
end