diff --git a/app/controllers/asia_databases_controller.rb b/app/controllers/asia_databases_controller.rb index f367dfb..acd6ed1 100644 --- a/app/controllers/asia_databases_controller.rb +++ b/app/controllers/asia_databases_controller.rb @@ -126,7 +126,9 @@ class AsiaDatabasesController < ApplicationController asia_data = asia_data.page(params[:page_no]).per(OrbitHelper.page_data_count) end asia_data_list = [] - if !params['keywords'].nil? + if params['keywords'].nil? + asia_data = nil + else if for_frontend asia_data_list = asia_data.collect do |asia_record| {'jps' => fields_to_show.map{|field| {"value"=> get_display_field(asia_record,field)}}} @@ -178,7 +180,7 @@ class AsiaDatabasesController < ApplicationController "asia_databases" => asia_data_list, "headers" => table_headers, "extras" => extras, - "total_pages" => asia_data.total_pages, + "total_pages" => (asia_data ? asia_data.total_pages : 0), 'choice_unit' => choice_unit, 'choice_field' => choice_field }