Created
June 30, 2010 05:48
-
-
Save pedro/458283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A few people asked about my issue with Rails 3 so here's the summary: | |
* Overriding to_json doesn't work anymore - render :json => User.all | |
seems to be ignoring any options defined in there. | |
* So I google around, there's a great explanation behind that, cool. | |
Lets move on and define as_json... | |
* Only it doesn't work if you try to call super with :only, :except, | |
or any of those options. Rails kept rendering all attributes. | |
* Things got worse when I added "json" to my Gemfile so I could test | |
that API giving me trouble. to_json starts raising "wrong number of | |
arguments" out of nowhere. | |
* Couldn't find any official doc for as_json. | |
* Ended up fixing my issue by reading the code. It's my fault I made | |
the wrong assumption about as_json, although I still don't see why | |
does it take arguments. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment