Rails jbuilder将属性附加到现有的json

时间:2014-03-07 18:01:16

标签: ruby-on-rails json ruby-on-rails-3 jbuilder

我有一个如下所示的jbuilder模板:

json.flights @campaign.flights do |flight|
  json.partial! 'flights/show', collection: @campaign.flights, as: :flight

  json.has_delivered flight.has_delivered?
end

在尝试渲染has_delivered时渲染部分后抛出错误。 "can't convert String into Integer"

有谁知道如何渲染这个?

0 个答案:

没有答案