I have tried this
validates :name, format: { with: /^[a-zA-Z0-9 ]*$/ }
but its giving error regular expression is using multiline anchors (^ or $)
Please guide me how to solve this.
I have tried this
validates :name, format: { with: /^[a-zA-Z0-9 ]*$/ }
but its giving error regular expression is using multiline anchors (^ or $)
Please guide me how to solve this.
Try this:
validates :name, format: { with: /\A[a-zA-Z0-9 ]+\z/ }
hope this will help you.