rails/jbuilder — Issue #5: recursive partial! not working
Author: pctj101
Created: 2011-12-09 12:48:41+00:00
State: open

Using ree 1.8.7 w/ jbuilder+patches from https://github.com/rails/jbuilder/pull/4

Lets say we have a nested comment tree (think discussion forum)

Let say we have a file:
index.json.jbuilder
===
json.comments @comments do |json, comment|
json.partial! "example/comment", :comment => comment
end

Then we have _comment.json.jbilder

json.id comment.id
json.comment comment.text
json.replies comment.replies do |json, reply|
logger.info "Hello" # this prints
json.partial! "example/comment", :comment => reply # this is where we go "recursive"
logger.info "World" # program never makes it this far
end