0
class LineItem
  def stock_status
    8, true
  end
end

Template

json.stock, json.required_stock = line_item.stock_status

Response

stock=: 6,
required_stock=: true

Want the response to be

stock: 6,
required_stock: true
chirag7jain
  • 1,485
  • 3
  • 26
  • 43

2 Answers2

0

Try:

class LineItem
  def stock_status
    [8, true]
  end
end
K M Rakibul Islam
  • 33,760
  • 12
  • 89
  • 110
0

try update template to

json.(line_item.stock_status, :stock, :required_stock)
Johnny Dương
  • 753
  • 3
  • 8