Marks invalid fields of semantic form, according to validation errors, received from server in JSON format.
Simply add FormtasticAjaxValidation to your Gemfile and bundle it up:
gem 'formtastic_ajax_validation'
Require javascripts assets:
= require formtastic_ajax_validation
Require stylesheets assets:
= require formtastic_ajax_validation
Having semantic form, like this:
= semantic_form_for User.new, :remote => true do |f| = f.inputs do = f.input :name = f.input :email
Bind validation to it via CoffeeScript:
FormtasticAjaxValidation $("#new_user"), "user", ["name", "email"]
Where “user” is a name of a model, and [“name”, “email”] are names of fields, that should reflect validation state.
Copyright © 2013 Anton Aljoshim, Web Deli Corporation. See LICENSE for details.