Friday, 15 June 2012

Rails 3.2 app with no models, which form validation to use? -


Currently, I am building a railway application that can get the necessary information about the model from a remote server Faraday uses so no model as far as I understand gem client_side_validation There is no use in this matter.
What am I asking about - Is the form validation ready to use ? Of course, it is always made of itself ...

To enable assumptions, you must activate only :: Verification is required. Please take a look at the module.

According to the docs:

  Active Model in the person of the class :: Validations attr_accessor: first_name ,: last_name validates_each: first_name ,: last_name do | Record, atri, value. Record.errors.add attr, starts with 'z'. If value.to_s [0] == z end end   

you can also use the validates_presence_of: name syntax.

No comments:

Post a Comment