turn a ruby hash into html list
- by JAlberto
I'm trying to parse a yaml file like this:
a:
a1:
a2:
b:
b1:
b11:
b2:
i get a hash like this:
{"a"=>{"a1"=>nil, "a2"=>nil}, "b"=>{"b1"=>{"b11"=>nil}, "b2"=>nil}}
and i want to turn it to a list:
%ul
%li a
%ul
%li a1
%li a2
%li b
%ul
%li b1
%ul
%li b11
%li b2
I'm trying to search the most efficent way doesn't matter how deep is the hash