Breaking Rendering Changes
If you’re using Rails’ render json: you don’t have to change anything:
render json: WidgetBlueprint.render(widget)
Otherwise, it now looks like this:
# JSON string
WidgetBlueprint.render(widget).to_json
# Hash (or array of Hashes if you passed an Enumerable)
WidgetBlueprint.render(widget).to_hash
Note
The legacy
render_as_hashandrender_as_jsonmethods are still present but may be removed in a future release.