X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8917fa82999bdf0020f623db9869abae99930b56..a131e0cc10dc70e6192fae0b4e0bce138d98ec5c:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index b62636166c..5c99c15abc 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -202,7 +202,7 @@ class ApplicationController < ActionController::Base return render_not_found("object not found") end respond_to do |f| - f.json { render json: @object.attributes.merge(href: url_for(@object)) } + f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) } f.html { if params['tab_pane'] render_pane params['tab_pane'] @@ -274,7 +274,7 @@ class ApplicationController < ActionController::Base @object ||= model_class.new @new_resource_attrs, params["options"] if @object.save respond_to do |f| - f.json { render json: @object.attributes.merge(href: url_for(@object)) } + f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) } f.html { redirect_to @object } @@ -436,6 +436,10 @@ class ApplicationController < ActionController::Base false # We may redirect to login, or not, based on the current action. else session[:arvados_api_token] = params[:api_token] + # If we later have trouble contacting the API server, we still want + # to be able to render basic user information in the UI--see + # render_exception above. We store that in the session here. This is + # not intended to be used as a general-purpose cache. See #2891. session[:user] = { uuid: user.uuid, email: user.email,