Skip to content

Instantly share code, notes, and snippets.

@dmix
Created December 4, 2009 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmix/248812 to your computer and use it in GitHub Desktop.
Save dmix/248812 to your computer and use it in GitHub Desktop.
#new.html.erb
<label>Username </label> <span class="string">&lt;%= f.text_field :username %&gt;&lt;span id="username_message" class="live_validation"&gt;&lt;/span&gt;</span>
<span class="string">&lt;%= observe_field :form_username,
:url =&gt; { :controller =&gt; :live_validations, :action =&gt; :validate_username },
:frequency =&gt; 0.5,
:update =&gt; :username_message,
:with =&gt; "username" %&gt;</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment