def demodulize(path)
      path = path.to_s
      if i = path.rindex("::")
        path[(i + 2)..-1]
      else
        path
      end
    end
def demodulize(path)
      path = path.to_s
      if i = path.rindex("::")
        path[(i + 2)..-1]
      else
        path
      end
    end
Removes the module part from the expression in the string.

   demodulize('ActiveSupport::Inflector::Inflections') # => "Inflections"
   demodulize('Inflections')                           # => "Inflections"
   demodulize('::Inflections')                         # => "Inflections"
   demodulize('')                                      # => ""

 See also #deconstantize.