diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-29 20:54:16 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 20:58:19 +0300 |
commit | a8887a0d9c4a41a0707b92189572aeff10566af6 (patch) | |
tree | 6c7fb9025c2f1ffc7ae82ecaeffd0facd21c042d /app/controllers | |
parent | 0bfcdd66bf932c080398ff264323b5c0df17d05c (diff) |
Use `resource` in Group Variables routing scheme
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 2f7058e95ea..c0eff63da18 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -2,7 +2,18 @@ module Groups class VariablesController < Groups::ApplicationController before_action :authorize_admin_build! - def save_multiple + def show + respond_to do |format| + format.json do + variables = @group.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 @group.update(variables_params) |