Jbuilder gives you a simple DSL for declaring JSON structures that beats manipulating giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops. You can either use Jbuilder stand-alone or directly as an ActionView template language. When required in Rails, you can create views à la show.json.jbuilder (the json is already yielded). Fragment caching is supported, it uses Rails.cache and works like caching in HTML templates. If your collection cache depends on multiple sources (try to avoid this to keep things simple), you can name all these dependencies as part of a block that returns an array.
Features
- Define attribute and structure names dynamically
- Top level arrays can be handled directly
- Merge existing hash or array to current context
- Extract attributes from array directly
- Make a plain array without keys
- Jbuilder objects can be directly nested inside each other
Categories
JSONLicense
MIT LicenseFollow Jbuilder
Other Useful Business Software
Passwordless Authentication and Passwordless Security
It’s no secret — passwords can be a real headache, both for the people who use them and the people who manage them. Over time, we’ve created hundreds of passwords, it’s easy to lose track of them and they’re easily compromised. Fortunately, passwordless authentication is becoming a feasible reality for many businesses. Duo can help you get there.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Jbuilder!