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

Project Samples

Project Activity

See All Activity >

Categories

JSON

License

MIT License

Follow Jbuilder

Jbuilder Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Jbuilder!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby JSON Software

Registered

2022-01-29