2011-05-19 22:35:13 +02:00
|
|
|
# ClientSideValidations Initializer
|
|
|
|
|
2013-07-08 14:32:24 +02:00
|
|
|
# Uncomment to disable uniqueness validator, possible security issue
|
2013-07-16 00:39:11 +02:00
|
|
|
# Disabled because of possible security issue and because of bug
|
|
|
|
# https://github.com/bcardarella/client_side_validations/pull/532
|
|
|
|
ClientSideValidations::Config.disabled_validators = [:uniqueness]
|
2013-07-08 14:32:24 +02:00
|
|
|
|
|
|
|
# Uncomment to validate number format with current I18n locale
|
2013-07-16 00:39:11 +02:00
|
|
|
# Foodsoft is currently using localize_input which is activated on certain
|
|
|
|
# fields only, meaning we can't globally turn this on. The non-i18n number
|
|
|
|
# format is still supported - so for now keep false.
|
2013-07-08 14:32:24 +02:00
|
|
|
# ClientSideValidations::Config.number_format_with_locale = true
|
2011-05-19 22:35:13 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|