finds.dev

DavyJonesLocker/client_side_validations

Client Side Validations made easy for Ruby on Rails

View on GitHub

★ 2,681RubyMITupdated Oct 2026

// the take

A Rails gem that mirrors your ActiveModel validation rules into client-side JavaScript so form fields get instant inline feedback without a round trip, then falls back to server validation for anything it can't safely replicate. It's for Rails shops that want cheap, consistent client-side form validation without hand-rolling JS validators for every model.

It introspects your actual ActiveModel/ActiveRecord validators and generates matching client rules, so you're not maintaining validation logic twice by hand. The 24.x rewrite dropped the jQuery dependency entirely in favor of native DOM APIs and native CustomEvents, which is a real improvement for bundle size and for apps that have otherwise purged jQuery. It explicitly bails out to server-side validation for conditional validators it can't safely evaluate client-side (e.g. :if/:unless with side effects), which avoids the classic failure mode of client validators silently diverging from server behavior. The plugin system extends it to other FormBuilders and ORMs (SimpleForm, Mongoid) without forking the core.

The 23.x→24.x jump is a hard breaking change: jQuery plugin methods are gone, every data-* attribute got renamed to a csv-namespaced version, and the whole event system moved from jQuery namespaced events to native DOM events — any app with custom validators, callbacks, or selectors tied to the old API has real migration work, not a drop-in bump. Uniqueness validation client-side is inherently approximate since it can't do a true server round-trip check without extra plumbing, so it's really just a convenience signal, not authoritative. Projects using `copy_assets` to vendor the compiled JS have to remember to re-run that generator on every gem upgrade or they'll silently run stale validation logic against newer server-side rules. It's also Rails/ActiveModel-specific by design, so any validation that isn't expressible as a standard ActiveModel validator still needs a hand-written local JS validator — this doesn't remove that class of work, it just handles the common cases.

We read the README, the directory tree and a key source file in November 2026. Nobody pays to be listed. How we judge →

search the same ground:

// at a glance

Stars
2,681
Forks
394
Language
Ruby
License
MIT
Last commit
28 Oct 2026

// nearby

If client_side_validations isn't quite it.

All repos →