解析JSON时出错:没有将String隐式转换为Integer

时间:2014-04-25 11:21:01

标签: ruby-on-rails json

我的代码:

    a = AppParam.find_by key: 'lowest_price'

    json.set! :response do
        json.array!(@products) do |product|
        json.extract! product, :id, :name, :description, :icon, :price, :tax, :is_active
        json.url product_url(product, format: :json)
    end

    json.extract! a, :value

引发此错误:

no implicit conversion of String into Integer in json.extratct! a, :value

0 个答案:

没有答案
相关问题