Changing RAILS_ROOT to Rails.root and making String.sub's first param be a regex and not a string