I am having a problem with the way RJS generates code. Say I have
html like this:
and RJS code like this:
parent = page["parent"]
the generated JS code becomes:
which is incorrect, because the second down() starts from within
#child1, whereas it should have started from within #parent.
By not declaring the "parent" variable and use page["parent"] for
every highlight() call it would work, but it's not very DRY. I could
also append a bunch of up() and down() in a long chain, but the code
gets messy difficult to follow.
I was wondering if there are any good ways to generate code that are
correct, clean, and DRY?
Thanks in advance!