<br><br><div><span class="gmail_quote">On 1/31/07, <b class="gmail_sendername">Ed Howland</b> <<a href="mailto:ed.howland@gmail.com">ed.howland@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I ran into this before, but I can't find any email from me about it.<br>Sorry if this is a repeat, but the problem persists in MV 0.3.1<br><br>If you have a helper method that you want to evaluate in a construct like:
<br><br><div mv:attr=":id => #{myhelper(arg)}"></div><br><br>it legitimately renders it so:<br><div id="<%= myhelper(arg) %>"></div><br><br>But if you increase the argument count to more than 1,
e.g.:<br><div mv:attr=":id => #{myhelper(arg, 1)}"><br><br>It renders:<br><div></div><br><br>You can try this in the interactive render. Perhaps it has something<br>to do with the commas? In any case, the bit between the '#{' and '}'
<br>should be dropped as is into the erb output. No parsing at all should<br>be done on this string.<br><br>In my case, I could not create an array for the args because it was a<br>mv:attr at the same level as the mv:block and one of the args was the
<br>bound variable ({|arg2| ...} of the block. In the end, I created a<br>closure with the other arg and called p.call(arg2) I don't think I<br>should have had to do that.<br><br>It only seems to occur with commas. Periods and other Ruby punctuation
<br>seem unaffected. My guess, w/o scouring the code, is you are looking<br>for a comma separating the key=>value pairs int the attribute hash.<br><br>This is a serious problem for me, as it crops up all the time. We<br>
create a series of elements (divs, trs etc.,) in a block, then combine<br>the block variable with something else to dynamically generate an id<br>(that we use later in a form or with some RJS call.) I can trick it in<br>most cases, but I want to DRY it with a helper. I should be able to
<br>pass any number of args to my helper.<br><br>Also, I could, I suppose, use <div id="{{{= myhelper(arg, 1) }}}"> but<br>that looks ugly in the designer, and I'd rather not.</blockquote><div><br><br>
</div></div>Thanks for the email Ed. I will try to get the fix in with the others we are preparing right now. Should be out very soon.<br><br>Blessings,<br><br>Jeff<br>