我想以 json 格式查看以下代码。当我这样做时,我得到一个没有内容的空白页面。在 rubymine 调试器中,我有 json 格式的正确信息。
include Java
require 'net/http'
class PatientRecordController < ApplicationController
def index
url = 'http://localhost:8080/patient/record/v2/'
data_raw = Net::HTTP.get_response(URI.parse(url)).body
@data_json = ActiveSupport::JSON.decode(data_raw)
respond_to do |format|
format.json {render json: @data_json}
end
end
end