Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

validation on mongoid always return false #275

Closed
kubido opened this Issue · 3 comments

2 participants

@kubido

Hi,

I use 'client_side_validations' gem and mongoid plugin "client_side_validations-mongoid".

I've this scenario:
1. validates_presence_of :recipient
2. if the recipient field not filled.. the field_with_errors element appear showing the message error "Can't be blank".
3. if I fill the recipient attribute and click submit button.. the form won't work.. I try to debug in the browser console. and go to this code (rails.validations.js line 77) :

$.fn.isValid = function(validators) { 
  if ($(this[0]).is('form')) {
      return validateForm($(this[0]), validators);
    } else {
      return validateElement($(this[0]), validators[this[0].name]);
    }
  };

the validators is always contain an error messages

Object
message[recipient]: Object
  presence: Object
    message: "can't be blank"

note: the form_for is build with

  include ActiveModel::Validations
  include ActiveModel::Conversion
  include ActiveModel::Naming

Is there anything left in my code?

@bcardarella
Owner

Can you try using master instead and see if that solves the issue?

@kubido

ahh.. it's working now.. thanks!

@bcardarella
Owner

Glad to hear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.