Added client side validations. Fixed shared sync.

This commit is contained in:
benni 2011-05-19 22:35:13 +02:00
parent 013637a4fc
commit 3f133bb8c3
8 changed files with 413 additions and 7 deletions

View file

@ -0,0 +1,14 @@
# ClientSideValidations Initializer
require 'client_side_validations/simple_form' if defined?(::SimpleForm)
require 'client_side_validations/formtastic' if defined?(::Formtastic)
# Uncomment the following block if you want each input field to have the validation messages attached.
# ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
# unless html_tag =~ /^<label/
# %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
# else
# %{<div class="field_with_errors">#{html_tag}</div>}.html_safe
# end
# end