module Scrivito class ParentPath def self.of(path) return if path.nil? return if path == '/' path.gsub(/\/[^\/]+$/, '').presence || '/' end end end