Here I want to output json with dynamic group name rather than word group
@tickets.each do |group, v|
json.group {
json.array! v do |ticket|
json.partial! 'tickets/ticket', ticket: ticket
end}
end
Where @ticket is a hash like this
{a: [....], b: [.....]}
and I want output like this
{a: [
.....
],
b: [
....
]}