I have written a simple ruby on rails app and have added all the validations I want on the fields in it, except I want to add a validation that will reject entries that are in bad taste/intentionally meant to annoy others. I try to install the validates_not_profane plugin (https://github.com/michaeledgar/validates_not_profane), the install fails whether I follow the instructions on its documentation ($script/plugin install validates_not_profane ... if that fails script/plugin install git://github.com/michaeledgar/validates_not_profane.git) and the console rejects these commands. When researching why this failed, I found this and followed both of these instructions Confused about how to install Rails plugins), both of which also failed. When I install its only dependency, the profanalyzer gem from the console ($ gem install profanalyzer) before attempting to install validates_not_profane, the install is successful. I also copied and pasted in the gemfile: "
gem 'profanalyzer', '~> 1.2'
When I go into: models > concerns > forms.rb: I add the validation on the last line to the list of validations that have been tested and work, and when I run it and refresh the browser, I get the error code seen in the image:
class Form < ApplicationRecord
validates :First_Name, presence: true
validates :LastName, presence: true
validates :Question1, presence: true
validates :Question1, length: { in: 10 .. 500 }
validates :age, :inclusion => { in: 18 .. 120 }
validates_not_profane :First_Name # THIS IS WHERE I AM GETTING AN
# UNINITIALIZED CONSTANT ERROR
[Error given from the line of code above][1]
end
Error given from the line of code above Even if I copied and pasted the code for the method validates_not_profane from the code on GitHub, I get the error code in the image:
What do i need to do to get this plugin installed and working?
I am running rails 5.0.0.1