Given the following Ruby data structure:
data = { :a => 1, :b => 2 }
... I want to create the following JSON:
{"result":[
{"letter":"a","number":"1"},
{"letter":"b","number":"2"}
]}
How do I accomplish this using Rails' JBuilder?
Ideally, I'd like to go directly from the Hash to the JBuilder object, without translating the Hash to an Array first.