Introducing Optimism: realtime remote form validation for Rails

female-mechanics.jpg

I’m proud to announce the public release of Optimism, a new Ruby on Rails gem that makes it easy to add realtime validation error messages to your applications.

When a model validation error prevents an update from succeeding, Optimism builds a list of issues that must be resolved. This list is broadcast to the browser over a websocket connection, and the live document is changed to show the necessary validation hints. No page refreshes are required and the entire process happens faster than you can blink.

Optimism injects text content, CSS class updates and even DOM events into your page. It has no client-side scripting requirements beyond a dependency to the awesome CableReady library. It automatically handles multi-level nested forms and plays well with other technologies, such as Turbolinks.

You can try a live demo right now.

Full documentation is available here. The project lives on Github here and you can get help via Discord here.

 
16
Kudos
 
16
Kudos

Now read this

Introducing jquery-events-to-dom-events (and jboo)

Did you know that jQuery events aren’t events? It’s true - and it’ll really mess up your night if you need to capture events from legacy jQuery components. Looking at you, hidden.bs.modal. I needed a way to make... Continue →