Using Judge with Formtastic

There’s now an extension gem to help you use Judge for client-side validation from within your Formtastic forms.

One of the modi operandi of Judge is to use the power of the FormBuilder to great effect. Coding forms is one of the great pains of front-end web development and I feel pretty confident in saying that nobody ever gets it completely right. Formtastic can help take some of the repetition and view clutter out of the process.

Adding Judge support to Formtastic turned out to be pretty easy. In fact, most of my time was spent marvelling at the Formtastic test suite, which is end-of-level bonkers.

Install

gem "judge-formtastic", "~> 0.1", :require => "judge/formtastic"

Sorry about the require option. The most recently released version of Bundler (1.0.22 at time of writing) doesn't correctly translate hyphen-delimited gem names into file paths before autorequiring. There's a fix for this already but I don't know when Bundler 1.1 will be released.

Update: Bundler 1.1 was released, so the require option is no longer necessary.

gem "judge-formtastic", "~> 0.1"