Skip to content
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

Problem with object @user => :person and node #665

Open
chinshr opened this issue Jun 26, 2016 · 0 comments
Open

Problem with object @user => :person and node #665

chinshr opened this issue Jun 26, 2016 · 0 comments

Comments

@chinshr
Copy link

chinshr commented Jun 26, 2016

I want to render the following JSON but don't seem to be able to do it with RABL. Can anybody help?

{"worker": {"id": 1, "name": "foo"}, "errors": {...}, "code": -5}

but instead the errors key is always rendered inside my worker object.

# update.rabl
object @worker => :worker
extends "api/workers/attributes"
node(:errors) {|w| w.errors }
node(:code) {|w| w.api_code }

This relates to answer in #222, but I want errors and code to be rendered as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant