Search code examples
ruby-on-rails-3.1mongoidclient-side-validation

client side validation don't show error message forms rails 3.1 Mongoid


I have installed ClientSideValidations

I have rails 3.1 + Mongoid and the text error message dont show in the form.

I follow the instruction for rails 3.1 in https://github.com/bcardarella/client_side_validations

I can only see the red color over my label in my form. You can see in this image:

enter image description here

What is the problem?

Thank you


Solution

  • You need to uncomment the code in config/initialzers/client_side_validations.rb to allow the error messages to display.

    By default it is commented out because this is the default behavior of Rails. I'm debating changing this for the 4.0 release of the gem as it is implied if you are installing the gem that you want the error messages too.