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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-29 20:39:06 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 20:58:18 +0300
commit0bfcdd66bf932c080398ff264323b5c0df17d05c (patch)
tree1c306a83624c53ec65ec67229de5033096d35593 /app/controllers/projects
parent6b82a9ef51f59d37975bd5de48142d1a0a8504de (diff)
Use `resource` in Project Variables routing scheme
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/variables_controller.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index 99dea65927d..2f03603bd1d 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -1,7 +1,18 @@
class Projects::VariablesController < Projects::ApplicationController
before_action :authorize_admin_build!
- def save_multiple
+ def show
+ respond_to do |format|
+ format.json do
+ variables = @project.variables
+ .map { |variable| variable.present(current_user: current_user) }
+
+ render status: :ok, json: { variables: variables }
+ end
+ end
+ end
+
+ def update
respond_to do |format|
format.json do
return head :ok if @project.update(variables_params)