Closed resistorsoftware closed 4 years ago
Hi!
Thanks for being part of the CSV Community.
The generated HTML is completely missing the data attribute with CSV validations: you should see a data-client-side-validations
attribute in the <form>
tag.
The most probable reason is that the node package is present in package.json
but the ruby gem is missing in Gemfile
.
Debugging CSV issues is a time consuming task, after you confirm that gem 'client_side_validations', '~> 17.0'
has been added to your Gemfile
, to speed up things, you could provide a repository with a reproducible test case
The ruby gem is not in fact missing, I stated in my explanation that version 17 is present and in the gem lockfile, and the initializer is present, and I uncommented the ActionView::Base monkeypatch that looks for labels and replaces their HTML etc.
As for a reproducible test case,I will just leave it here... why does the HTML render a form with no data attributes? It seems that is the job of the gem, the gem is installed, and the initializer is in place. Is there some other configuration that has to happen?
As for a reproducible test case,I will just leave it here... why does the HTML render a form with no data attributes?
I cannot reproduce
It seems that is the job of the gem, the gem is installed, and the initializer is in place. Is there some other configuration that has to happen?
Nope
Ok.. thanks anyway. I will abandon this gem approach and go with formik... I know that library works!
Steps to reproduce*
Rails 6, installed client_side_validations gem 17.0
Expected behavior*
Expecting to see client-side validation because in the browser console if I query for the object ClientSideValidations it exists.
Active Record is working server-side:
Actual behavior*
There is zero influence on the client form. It is as if nothing has been added. No client side verification happens
System configuration*
Rails version: 6.0.3.3
Ruby version: 2.6.5
Client Side Validations version: 17.0
Code snippet from your model of the validations*
The whole form code from your template*
<%= form_with model: @shop, validate: true do |f| %>
<%= f.text_field :domain, class: 'form-control m-2' %>
<%= f.text_field :token ,class: 'form-control m-2' %>
<%= f.text_field :brand_name ,class: 'form-control m-2' %>
<%end%>
The resulting HTML*
Browser's development console output*
Additional JavaScript Libraries*
Repository demostrating the issue
Debugging CSV issues is a time consuming task. If you want to speed up things, please provide a link to a repository showing the issue.
* Failure to include this requirement may result in the issue being closed.