# gazay/gon

Your Rails variables in your JS

Repository: https://github.com/gazay/gon
Canonical: https://ross.abutalabs.com/products/gon
Language: Ruby
License: MIT
License Family: permissive
Last push: 2026-08-23T07:20:42+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 76, longevity 100
- inputs: {"age_days": 5595, "days_push": 10, "days_rel": 83, "gap_med": 87, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3101, forks 185 (observed 2026-08-28T04:07:43.574359+00:00)

## What it is
Gon is a Ruby gem for Rails that lets you pass server-side variables from controllers directly into your JavaScript with a single layout tag. It supports Jbuilder and Rabl templates and offers gon.watch for refreshing variables via AJAX.

## Use cases
- pass Rails controller data to JavaScript without inline scripts
- share server-side variables with frontend JS files
- renew data in JS variables through AJAX with gon.watch
- serialize controller data using Jbuilder or Rabl templates
- avoid parsing data attributes in JavaScript

## When to choose
- you maintain a Rails app and need to hand server data to client-side JS
- you want a simple, battle-tested way to expose variables in the layout
- you need periodic data refreshes in JS via gon.watch

## When to avoid
- you build SPAs with a JSON API and a separate frontend framework
- your stack is not Ruby/Rails (use the ports for Sinatra, .NET, or Phoenix instead)
- you only need static assets or no server-to-client data passing

## Facets
- artifact type: library
- maturity: maintenance
- function: templating, serialization, web-framework
- domain: web-development, backend, frontend
- platform: ruby
- tags: rails, ruby-gem, server-to-client-data, jbuilder, rabl, sinatra, web-server

## Member repositories
- gazay/gon (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:43.574359+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:46:21.312723+00:00, confidence not recorded.
  - readme: https://github.com/gazay/gon (fetched 2026-08-28T04:07:43.574359+00:00, sha b103d299f4ea)
- Data as of 2026-08-30T08:39:29.467469+00:00.
