def merge_controller(content, namespaces, index, values = {})

      if (index == (namespaces.length - 1))
        content[namespaces[index]] = {} unless content.has_key?(namespaces[index])
        content[namespaces[index]].merge!(values)
      else
        content[namespaces[index]] = {} unless content.has_key?(namespaces[index])
        content[namespaces[index]] = merge_controller(content[namespaces[index]], namespaces, index + 1, values)
      end
      return content
    end
def merge_controller(content, namespaces, index, values = {})

      if (index == (namespaces.length - 1))
        content[namespaces[index]] = {} unless content.has_key?(namespaces[index])
        content[namespaces[index]].merge!(values)
      else
        content[namespaces[index]] = {} unless content.has_key?(namespaces[index])
        content[namespaces[index]] = merge_controller(content[namespaces[index]], namespaces, index + 1, values)
      end
      return content
    end
Recursive method