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

Unable to use extends with a collection and node in the partial. #396

Open
ericgross opened this issue Jan 29, 2013 · 0 comments
Open

Unable to use extends with a collection and node in the partial. #396

ericgross opened this issue Jan 29, 2013 · 0 comments

Comments

@ericgross
Copy link

I have a RABL template that shows a collection (/api/friends/index.json.rabl):

collection @friends
node(:uid) { |f| f['uid'] }

This works fine. I want to break out the node though into a partial so that I can reuse it elsewhere. I have tried this:

/api/friends/index.json.rabl:

extends 'api/friends/show'
collection @friends

And the partial (/api/friends/show.json.rabl):

node(:uid) { |f| f['uid'] }

But I am getting this error:

TypeError in Api/friends#index

Showing /opt/appname/app/views/api/friends/index.json.rabl where line #1 raised:

can't convert String into Integer
Extracted source (around line #1):

1: extends 'api/friends/show'
2: collection @friends

It seems to me that extends is what I am looking for rather than partial because I want it at the top level (not inside of a child).

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