Rails "client-side validation form_for error"

I use corrugation to validate the client, and I got this error. Any idea .....

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

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

Template inclusion tracking: app / views / users / new.html.erb

+6
source share
4 answers

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

However, he also points out

I donโ€™t see CSV 4.0 coming out for at least 2 months after Rails 4.0 has landed (hopefully not so long), as there will be significant changes on the JavaScript side. Since this will take longer and people will want to get a CSV version compatible with Rails 4.0, offering to use the master branch or perhaps release the alpha version or the preview version to partially satisfy them while we update, maybe the right option.

So maybe try pulling csv straight from git? There is a beta 4.0 that you can try ...

Update

The CSV gem is no longer supported. The repository has 3 different 4.0 branches, and the last updated of which is 4-0 usable ( https://github.com/bcardarella/client_side_validations/branches/all ).

Update 2

According to @TheChamp, now the CSV pearl supports 4.2 rails!

+4
source

Rails 4 Support

Thanks to tagliala and bcardarella client_side_validation gem now supports 4 rails!

After adding

 gem 'client_side_validations' 

for my gemfile , it did not load everything correctly.

This may be temporary, since Rubygems only links the old version . Instead, I had to specify the exact repository and branch, as the owner has changed.

 gem 'client_side_validations', github: "DavyJonesLocker/client_side_validations", branch: "4-2-stable" 
+11
source

If you use Rails 4, then client-side validation is out of date. You can check here

http://railscasts.com/episodes/263-client-side-validations?view=comments

and also if you go to the github page

https://github.com/bcardarella/client_side_validations

you can see that he says that he is no longer supported.

Alternatively, you can try using the CSV stone from this branch, replacing the CSV line in the Gemfile with

gem 'client_side_validations', github: "bcardarella / client_side_validations" ,: branch => "4-0-beta"

Not sure even if this will work. Since its obsolescence.

Or you can check out this gem,

https://github.com/kalkov/rails4_client_side_validations

Just modified client-side validation version

+2
source

Have you followed all the instructions on the github page? If so, restart the server? The installation adds an initializer that will not work until the server restarts.

+1
source

Source: https://habr.com/ru/post/947098/


All Articles