Answer the question
In order to leave comments, you need to log in
Rails JSON include in top level?
Hello. Is it possible to make an include like in the example?
menu_requirement.to_json(
only: [ :number ],
include: { institution: { only: :name } } )
{
"number": "KL-000000053",
"institution": {
"name": "18 (ДОУ)"
}
}
{
"number": "KL-000000053",
"institution_name": "18 (ДОУ)"
}
}
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