2015-10-24 18:46:33 +05:30
|
|
|
class Projects::VariablesController < Projects::ApplicationController
|
2016-04-02 18:10:28 +05:30
|
|
|
before_action :authorize_admin_build!
|
2015-10-24 18:46:33 +05:30
|
|
|
|
|
|
|
layout 'project_settings'
|
|
|
|
|
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2015-12-23 02:04:40 +05:30
|
|
|
if project.update_attributes(project_params)
|
2015-10-24 18:46:33 +05:30
|
|
|
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
|