У меня есть следующий массив объектов json.
[{"template":{"title":"title 1"}},{"template":{"title":"title 1"}},{"template":{"title":"title1111"}},{"template":{"title":""}},{"template":{"title":""}},{"template":{"title":"this is the title"}},{"template":{"title":"title232"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"title with msg"}},{"template":{"title":"this is a title"}},{"template":{"title":"this is a title"}},{"template":{"title":"this is a title"}},{"template":{"title":"some title"}},{"template":{"title":"some title"}},{"template":{"title":"some title"}},{"template":{"title":"some title"}}]
Я хочу, чтобы этот массив был похож на
[{'title': 'some title'}, {'title': 'some other title'}, ...]
, поэтому в основном я не хочу, чтобы свойство шаблона внутри jsответ.я получаю это из следующего кода рельсов
@templates = Template.find_all_by_user_id(current_user.id, :select=>'title', :conditions=>"title is not null")
@templates.to_json
это то, что дает мне этот массив объектов JSON
какие-либо предложения?