Validation error messages for JS


I try to create javascript client side form validation for rails models
I don’t wont to duplicate error messages in language yml files (one for
models and one for javascript). I wont for example to generate json
with list of all available error messages for some active record rails
model. Is there any way to get these error messages before I validate
model. In rails documentation model.errors is available after validation
order to display them with javascript before form is submitted and
is attached to model and model is validated. I want to display error to
user before form submittion.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs