Closed marvintrejoxi closed 4 years ago
@marvintrejoxi , the validation syntax you have is wrong, check out the documentation of Dry.
Also you need to add feature Dry
in the contract.
@seuros i have that in one initializer
/conf/initializer/reform.rb
require 'reform/form/dry'
Rails.application.config.reform.validations = :dry
Reform::Form.class_eval do
feature Reform::Form::Dry
end
however, I always get the same error
https://dry-rb.org/gems/dry-validation/1.3/
The block validation
is the Dry::Validation::Contract
@seuros can you give an example of a contract with validations? because, i dont understand you :(
validation do params do required(:name).filled end end
But check the documentation, a lot of things changed between 0.x and 1.3.
On Thu, Nov 28, 2019 at 7:24 PM Marvin Trejo notifications@github.com wrote:
@seuros https://github.com/seuros can you give an example of a contract with validations? because, i dont understand you :(
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trailblazer/reform/issues/504?email_source=notifications&email_token=AASIUTZIWEBE4WNL3WZTFG3QWAEFNA5CNFSM4JSXINXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNH6MY#issuecomment-559578931, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASIUT6R4ZIUTXYUWBFVZFTQWAEFNANCNFSM4JSXINXA .
I have been getting this error with dry-validation in my contract
this is my contract:
and Im using those gems:
any idea why dry validation doesn't work correctly with reform gem in that version?