X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cffa37b8680c2730934b7f474836312bb7a1fe73..7a5eb1b19c698f39b7cfdaafa4b3deefe556b07e:/apps/workbench/app/controllers/collections_controller.rb?ds=sidebyside diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index bfba2f57f8..515cdf1867 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -350,18 +350,19 @@ class CollectionsController < ApplicationController end def save_tags - tags = nil - if params['tag_data'] - tags = params['tag_data'] - elsif params['empty'] - tags = {} + tags_param = params['tag_data'] + if tags_param + if tags_param.is_a?(String) && tags_param == "empty" + tags = {} + else + tags = tags_param + end end if tags - props = @object.properties - props[:tags] = tags - - if @object.update_attributes properties: props + if @object.update_attributes properties: tags + @saved_tags = true + render else self.render_error status: 422 end