rectify
rectify copied to clipboard
How to use model methods in rectify form ?
If you use phony_rails gem, you can use something like this:
class Model
validates :phone,
phony_plausible: true,
format: { with: /\A\+\d+/, message: 'should start with +' }
phony_normalize :phone # this is used before validation
end
How to inlude the same code in rectify form ? It looks that I cannot add phony_normalize
method, so for now I will add it to model :crying_cat_face:
I suppose since phony_normalize
is included in ActiveModel::Model
to solve your problem just include ActiveModel::Model