Skip to content

Instantly share code, notes, and snippets.

@jdsampayo
Created January 9, 2012 20:22
Show Gist options
  • Save jdsampayo/1584749 to your computer and use it in GitHub Desktop.
Save jdsampayo/1584749 to your computer and use it in GitHub Desktop.
Rails me la da asi:
[
{ "title": "RestKit Object Mapping Intro",
"body": "This article details how to use RestKit object mapping...",
"author": "Blake Watters",
"publication_date": "7/4/2011"
},
{ "title": "RestKit 1.0 Released",
"body": "RestKit 1.0 has been released to much fanfare across the galaxy...",
"author": "Blake Watters",
"publication_date": "9/4/2011"
}
]
con el ActiveResource::Base.include_root_in_json = true
[
"article": { "title": "RestKit Object Mapping Intro",
"body": "This article details how to use RestKit object mapping...",
"author": "Blake Watters",
"publication_date": "7/4/2011"
},
"article": { "title": "RestKit 1.0 Released",
"body": "RestKit 1.0 has been released to much fanfare across the galaxy...",
"author": "Blake Watters",
"publication_date": "9/4/2011"
}
]
pero lo necesito asi:
{ "articles": [
{ "title": "RestKit Object Mapping Intro",
"body": "This article details how to use RestKit object mapping...",
"author": "Blake Watters",
"publication_date": "7/4/2011"
},
{ "title": "RestKit 1.0 Released",
"body": "RestKit 1.0 has been released to much fanfare across the galaxy...",
"author": "Blake Watters",
"publication_date": "9/4/2011"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment