标签: ruby-on-rails
我正在从数据库中渲染json
render json: @monitorings, :include => [:company => {:only[:name]}]
我希望输出是
{ key1: values, key2: values2, company: name }
实际输出
{ key1: values, key2: values2, company: { name: value3 } }
如何将:name呈现为值而不是对象
:name