Forum: Ruby on Rails Validation error messages for JS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C608e4424e9c8d08c6ae839a87ab2941?d=identicon&s=25 Dalibor Zdravkovic (Guest)
on 2014-03-22 16:39
(Received via mailing list)
Hello,

I try to create javascript client side form validation for rails models
and
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
object
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
in
order to display them with javascript before form is submitted and
values
is attached to model and model is validated. I want to display error to
the
user before form submittion.
This topic is locked and can not be replied to.