-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix json render #24
fix json render #24
Conversation
@@ -14,7 +14,7 @@ def check | |||
respond_to do |format| | |||
format.html | |||
format.json do | |||
render json: statuses | |||
render json: statuses.to_json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
render json: statuses
should have worked out of the box, so I'm not sure why it didn't work for you. Are you using any special or outdated serialization gems/overrides?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, you're right. Did a quick dig and found the culprit to be the gem active_model_serializers
. That being said, it doesn't hurt by adding that explicit conversion in, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might look weird why is it explicitly converted this way, while not in other places. Can you add statuses.to_xml
below, for symmetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Thanks for the contribution! |
hey all, we're running into the following issue with serialization when rendering as json: