I'm using Stripe within a model class. I have a strike_token
attribute that I am validating presences of and creating a custom message like so:
validates :stripe_token, presence: { message: 'Please enter valid card info' }
When the form is submitted and not valid, the error message is, "Stripe token Please enter valid card info"
I don't want Stripe token in the error message. I have other validations as well that would be suited for the default, so I don't want to change the default error behavior.
It would be better if I could alias the Stripe token attribute to something like :card_info
without actually having that as an attribute on the model.
So the message could be made to read, "Card info cannot be blank"