[PATCH/RFC] Make element ids unique

Hi devs,

The template compiler for elements automatically sets the instance
variable @id based on either an explicit id attribute in the html or the
name of the class.

e.g.
class LoginBox
def render
%~

~
end
end

This will result in

...
...
...
...
...

Also, when nesting elements the children are kept in a Dictionary and
the @id is used as lookup key, so in the above example only the third
and the fifth box would be visible for the parent.

The attached patch changes the element compiler to make ids unique by
adding a number where necessary, so the above example would become

...
...
...
...
...

Are there any objections to this being applied?

Thank you!
(ab)

I have done something similar in the past, but due to some problems I
removed it.
The bad thing is that I do not remember the actual problems any more :frowning:

In any case, thanks for the patch. I will have a look at it and apply
it if
it doesnt break my tests/apps.

thanks,
-g.