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

Rabl.render doesn't work with partials #316

Closed
yjukaku opened this issue Aug 22, 2012 · 3 comments
Closed

Rabl.render doesn't work with partials #316

yjukaku opened this issue Aug 22, 2012 · 3 comments
Labels

Comments

@yjukaku
Copy link

yjukaku commented Aug 22, 2012

Using Rabl.render in my controller like so:

@response = Rabl.render(@device, "messages/requestConfig", :view_path => 'app/views', :format => :json)

with a requestConfig.rabl in app/view/messages/requestConfig

object false

node :device_id do
  @device.id
end

node :configurations do
[
  partial("configs/message", :object => @device.config)
]

gives this error:

Cannot find rabl template 'configs/message' within registered () view paths!

It seem's that the view_path option is lost across calls to partial rendering?

@databyte
Copy link
Collaborator

databyte commented Sep 5, 2012

I'm not having an issue with finding the template in a new test that I just wrote. The problem I do seem to have is that the partial's results don't get included in the final output. It gets executed, just not returned.

I'll look at that part of the issue later but did you ever figure out the path issue? Can you use extend instead?

@yjukaku
Copy link
Author

yjukaku commented Sep 19, 2012

Sorry, I don't even remember what I did. I think I just worked around the issue.

@zenith-777
Copy link

Thank you yjukaku, I saw you specified the ":view_path" option in your code and it helped me with my node - partials issue :D

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

No branches or pull requests

3 participants