Rails 的客户端验证 form_for 错误 [英] Rails' client-side-validation form_for error

查看:39
本文介绍了Rails 的客户端验证 form_for 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用客户端验证 rails gem,但出现此错误.任何想法......

I am using client validation rails gem and I got this error. Any idea.....

参数数量错误(3 代表 2)提取的源代码(围绕第 1 行):

wrong number of arguments (3 for 2) Extracted source (around line #1):

<%= form_for @user, :validate => true do |f| %>

模板包含的痕迹:app/views/users/new.html.erb

Trace of template inclusion: app/views/users/new.html.erb

推荐答案

基于 https://github.com/bcardarella/client_side_validations/issues/494 看起来 CSV 将不再支持 Rails 4.

Based on https://github.com/bcardarella/client_side_validations/issues/494 it looks like CSV will not support Rails 4 for a little bit longer.

然而它也说明

在 Rails 4.0 发布后至少 2 个月内(​​希望不会那么长),我认为 CSV 4.0 不会出现,因为 JavaScript 方面会发生重大变化.因为这需要更长的时间,人们会想要一个符合 Rails 4.0 的 CSV 版本,建议他们使用 master 分支,或者发布一个 alpha 或 pre 版本来部分满足他们,而我们更新可能是正确的选择.

I don't see CSV 4.0 coming out for at least 2 months after Rails 4.0 lands (hopefully not that long) as there will be major changes on the JavaScript side of things. Because it will take so longer and people will want a Rails 4.0 compliant version of CSV suggesting they use master branch or perhaps releasing a alpha or pre version to partially satisfy them while we update might be the correct option.

那么也许可以尝试从 git 中直接提取 csv ?有一个 4.0 beta 分支可能值得一试...

So perhaps try pulling csv right from git? There is a 4.0 beta branch that might be worth trying...

更新

CSV gem 不再积极维护.存储库中有 3 个不同的 4.0 分支,最近更新的是 4-0-useable (https://github.com/bcardarella/client_side_validations/branches/all).

The CSV gem is no longer actively maintained. There are 3 different 4.0 branches on the repository, and the most recently updated of which is 4-0-useable (https://github.com/bcardarella/client_side_validations/branches/all).

更新 2

正如@TheChamp 所说,CSV gem 现在支持 rails 4.2!

As @TheChamp says, the CSV gem now supports rails 4.2!

这篇关于Rails 的客户端验证 form_for 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆