X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8ebf6b6a0911f336e5cb5a31ac8aa8bb4cc0d6d1..3c6f8001fb5d63ef92da36e662ac58396f18a9d0:/apps/workbench/app/controllers/application_controller.rb?ds=inline diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 02ebc8b3a1..e94428e92d 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -107,9 +107,10 @@ class ApplicationController < ActionController::Base end def create - @object ||= model_class.new params[model_class.to_s.singularize.to_sym] + @object ||= model_class.new params[model_class.to_s.underscore.singularize] @object.save! respond_to do |f| + f.json { render json: @object } f.html { redirect_to(params[:return_to] || @object) } @@ -120,6 +121,7 @@ class ApplicationController < ActionController::Base def destroy if @object.destroy respond_to do |f| + f.json { render json: @object } f.html { redirect_to(params[:return_to] || :back) }