AJAX Rails的验证AJAX、Rails

2023-09-10 16:47:18 作者:我特么是绝版

我有我的形式和验证工作的伟大与普通HTTP请求。我想它使用AJAX。我知道我可以在客户端验证,但似乎多余因为我已经在我的模型中定义的验证。

I have my form and validation working great with regular http requests. I would like it to use AJAX. I know i can validate on the client side but that seems redundant given that I have defined the validations in my model.

当用户填写表单,我想给反馈,他们在他们的作品。什么是使用轨道定义的验证在AJAX的形式,并给予实时反馈的最佳方法是什么?

As the user is filling out the form, I'd like to give feedback to them on their entries. What is the best way to use the rails defined validations in an AJAX form and give live feedback?

推荐答案

查看实时验证插件。另外还有一个介绍截屏。