Answer the question
In order to leave comments, you need to log in
Ruby ActiveRecord.as_json keys like Sybmol?
Hello. Could you tell? How, for example, to unload the table in JSON, so that the keys would be like Symbol.
Here it unloads where the row keys are:
value = Test.all.as_json # [{"id"=>1 },{"id"=>2 }]
# а надо [{:id=>1}, {:id=>2}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question