rectify icon indicating copy to clipboard operation
rectify copied to clipboard

How to use model methods in rectify form ?

Open rusikf opened this issue 7 years ago • 1 comments

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:

rusikf avatar Jun 09 '17 13:06 rusikf

I suppose since phony_normalize is included in ActiveModel::Model to solve your problem just include ActiveModel::Model

bypotatoes avatar Oct 04 '17 18:10 bypotatoes