class LineItem
def stock_status
8, true
end
end
模板
json.stock, json.required_stock = line_item.stock_status
响应
stock=: 6,
required_stock=: true
希望回复
stock: 6,
required_stock: true
答案 0 :(得分:0)
尝试:
class LineItem
def stock_status
[8, true]
end
end