Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow nesting of Jbuilder objects #23
Small change that detects when another jbuilder object is being added. This allows chaining objects together in a manner similar to partials. Very useful when using jbuilder outside of rails templates.
A contrived example:
class Person def to_builder person = Jbuilder.new person.(self, :name, :age) end end class Company def to_builder company = Jbuilder.new company.name name company.president president.to_builder end end puts company.to_builder.target!