finds.dev← search

// the find

amatsuda/jb

★ 1,315 · Ruby · MIT · updated Jan 2026

A simple and fast JSON API template engine for Ruby on Rails

Jb is a drop-in Jbuilder replacement for Rails JSON views. Instead of a custom DSL, you write plain Ruby that returns a Hash or Array, which gets serialized to JSON. If you're using Jbuilder's `partial` + `:collection` on any meaningful dataset, this fixes a real performance bug in Jbuilder.

The collection partial performance is the main reason to use this — Jbuilder calls `find_template` once per item in a collection, which is O(n) on one of ActionView's slowest operations. Jb calls it once. The benchmarks aren't cherry-picked; this is a real Jbuilder architectural flaw. The 'no DSL' approach pays off in debuggability: you can drop a `binding.pry` in a `.jb` template and inspect state normally, which you can't do inside Jbuilder's `json.field` blocks. Rails view helpers work natively since the template runs inside the view context. Zero learning curve if you know Ruby.

The library is essentially a solved problem with no active roadmap — 1315 stars and 42 forks after years of existence signals adoption ceiling, and the last push being from early 2026 on a repo that's been around since Rails 5 suggests it's maintenance mode at best. No built-in key formatting (Jbuilder has `key_format! camelize: :lower`); you'd handle that yourself. Partials returning `nil` on empty collections is a footgun they document but don't fix — that's a Rails behavior Jbuilder works around that Jb leaves to the caller. If your codebase has hundreds of existing `.jbuilder` views, migration is a manual rewrite.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →