I'm a pretty new Rails developer, I'm using Jbuilder to build my view in the following way:
[:aaa, :bbb, :ccc].each do |value|
json.value do |json| #<------ Here is my error!
json.partial! foo.send(value)
end
end
Everything works BUT the json.value
, my response is the following (obviously):
[{
"value" => {...}
"value" => {...}
"value" => {...}
}]
I'd like to have this one instead:
[{
"aaa" => {...}
"bbb" => {...}
"ccc" => {...}
}]
Any ideas?
From the guide:
The solution is so: