I am building a long list of terms I would like to prevent from entry into a field using validates_exclusion_of
. This list is getting very long, and some of the terms in it may be inappropriate/offensive/distracting/procrastination-inducing for other programmers. Is there a way to connect the following code to a separate plain text document held somewhere on my repo?
validates_exclusion_of :path, :in => %w( long list of bad words ... ), :message => "This is a protected word. Please try another."
Bonus: this message doesn't display on my form when a user enters one of these terms. How do I get the message to display?