1
Hello, I’m a beginner in Ror. I have a form with field for CPF and need to validate whether it is valid or not before saving the record.
I tried different Gems like: Gem'cpf_cnpj', Gem 'brcpfcnpj' and 'validates_cpf_cnpj', but following the readme on github, they all gave some kind of error, perhaps by the compatibility of ruby or Rails.
My last attempt was to use a Ruby code and create a custom validate, but I was also unsuccessful.
Does anyone have any solution using Rails 5?
You can also use the solution provided by this link: http://codigofonte.uol.com.br/codigos/validaca-de-cnpj-com-ruby
– Tiago Tiede
Thanks! Strange that the first time I tried to use this Gem gave error exactly in require... but now it worked!
– Cleber Reizen