Forum: Ruby on Rails Validation error messages for JS

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dalibor Zdravkovic (Guest)
on 2014-03-22 16:39
(Received via mailing list)

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 topic is locked and can not be replied to.