X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b917e8a2ebf8c51729ecde1d3cc3396d2fcf0034..5d87bcae66870127445e5eb018a69d606e93e244:/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 833294b5b0..e88d38e2ad 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -164,32 +164,31 @@ class ApplicationController < ActionController::Base def find_objects_for_index @objects ||= model_class @objects = @objects.filter(@filters).limit(@limit).offset(@offset) + @objects.fetch_multiple_pages(false) end def render_index - if params[:partial] - respond_to do |f| - f.json { - @next_page_href = next_page_href(partial: params[:partial]) + respond_to do |f| + f.json { + if params[:partial] + @next_page_href = next_page_href(partial: params[:partial], filters: @filters.to_json) render json: { - content: render_to_string(partial: "show_#{params[:partial]}.html", formats: [:html]), - next_page_href: @next_page_href - + content: render_to_string(partial: "show_#{params[:partial]}", + formats: [:html]), + next_page_href: @next_page_href } - } - end - else - respond_to do |f| - f.json { render json: @objects } - f.html { - if params[:tab_pane] - render_pane params[:tab_pane] - else - render - end - } - f.js { render } - end + else + render json: @objects + end + } + f.html { + if params[:tab_pane] + render_pane params[:tab_pane] + else + render + end + } + f.js { render } end end @@ -220,6 +219,8 @@ class ApplicationController < ActionController::Base if !objects objects = @objects end + # result_limit and result_offset won't work until we call #results + objects.results if objects.respond_to?(:result_offset) and objects.respond_to?(:result_limit) and objects.respond_to?(:items_available)