,I need to validate a form field so it cannot be a specific string. For example if someone inputs “hello” into a text field and submits the form, how can I throw an error saying that particular string is not allowed? Is there a way to avoid doing this on the client side with javascript so I can keep the feel consistent?
validates_presence of :field_name, #condition here
you need to pass custom validation
call this method