Hi all. I just confirmed this issue with mv:attr The directive help page says that you can use #{} to create an erb in the attribute value. This works only somewhat. E.g <div mv:attr=":id => #{kase_id}" /> ...becomes... <div id="<%= kase_id %>" /> <div mv:attr=":id => #{kase_id 1}" /> ...becomes... <div id="<%= kase_id 1 %>" /> But <div mv:attr=":id => #{kase_id 1, 2}" /> ...becomes... <div /> And it matters not if you use parens on the helper <div mv:attr=":id => #{kase_id(1}" /> ...becomes... <div id="<%= kase_id(1) %>" /> But <div mv:attr=":id => #{kase_id(1,2)}" /> ...becomes... <div /> This happens after the first parameter to any helper function (2, 3, ... n parameters.) Ed -- Ed Howland http://greenprogrammer.blogspot.com
Thanks for pointing it out Ed. I will take look and see if I can resolve it. On 12/28/06, Ed Howland <ed.howland at gmail.com> wrote:> > Hi all. > > I just confirmed this issue with mv:attr > > The directive help page says that you can use #{} to create an erb in > the attribute value. This works only somewhat. > > E.g > <div mv:attr=":id => #{kase_id}" /> > ...becomes... > <div id="<%= kase_id %>" /> > > <div mv:attr=":id => #{kase_id 1}" /> > ...becomes... > <div id="<%= kase_id 1 %>" /> > > But > <div mv:attr=":id => #{kase_id 1, 2}" /> > ...becomes... > <div /> > > And it matters not if you use parens on the helper > <div mv:attr=":id => #{kase_id(1}" /> > ...becomes... > <div id="<%= kase_id(1) %>" /> > But > <div mv:attr=":id => #{kase_id(1,2)}" /> > ...becomes... > <div /> > > This happens after the first parameter to any helper function (2, 3, > ... n parameters.) > > Ed > > -- > Ed Howland > http://greenprogrammer.blogspot.com > _______________________________________________ > Masterview-devel mailing list > Masterview-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20061228/b0c27eec/attachment.html
On 12/28/06, Ed Howland <ed.howland at gmail.com> wrote:> > Hi all. > > I just confirmed this issue with mv:attr > > The directive help page says that you can use #{} to create an erb in > the attribute value. This works only somewhat. > > E.g > <div mv:attr=":id => #{kase_id}" /> > ...becomes... > <div id="<%= kase_id %>" /> > > <div mv:attr=":id => #{kase_id 1}" /> > ...becomes... > <div id="<%= kase_id 1 %>" /> > > But > <div mv:attr=":id => #{kase_id 1, 2}" /> > ...becomes... > <div /> > > And it matters not if you use parens on the helper > <div mv:attr=":id => #{kase_id(1}" /> > ...becomes... > <div id="<%= kase_id(1) %>" /> > But > <div mv:attr=":id => #{kase_id(1,2)}" /> > ...becomes... > <div /> > > This happens after the first parameter to any helper function (2, 3, > ... n parameters.) > > EdI have found and fixed the issue. It had to do with simplistic logic in the parsing using regular expressions. I enhanced AttrStringParser and changed mv:attr to use that instead. AttrStringParser takes nesting and more things into consideration so it doesn''t split prematurely on the comma. I added some test cases to verify. Also I added mv:select to the alphabetic list of directives on the bottom of the directives.html page which you mentioned was missing. Since this was such a small fix and there are a few other things I would like to put in, I am going to hold off on pushing out a 0.3.2 release but will email you the 0.3.1.1 gems in a followup email. The code is checked into the trunk. Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20061228/40744d09/attachment.html