config/initializers/core_extensions.rb
# Normalize a string for better matching, e.g. for searches
Normalize a string for better matching, e.g. for searches
Normalize a string for better matching e . g . for searches
def capitalize_all_words
    string = self.clone
    unless string.blank?
      string = string.split(/ /).map do |w|
        ignores = String.words_not_to_capitalize[I18n.locale.to_sym]
        if(ignores && ignores.include?(w.downcase))
          w.downcase
        else
          w.firstcap
        end
      end.join(' ')
    end
    string
  end
def capitalize_all_words string = self . clone unless string . blank? string = string . split ( / / ) . map do | w | ignores = String . words_not_to_capitalize [ I18n . locale . to_sym ] if ( ignores && ignores . include? ( w . downcase ) ) w . downcase else w . firstcap end end . join ( ' ' ) end string end
Normalize a string for better matching, e.g.
Normalize a string for better matching e . g .