Open fatshotty opened 11 years ago
What version of Grails are you using?
Thanks for replying
Grails version 2.1.1
Haml4Grails works fine but the &&
condition :-/
JHaml doesn't know to skip HTML escaping within a ${...} expression for attribute values. Thanks for bringing that to light, I'm working on fixing it.
In the mean time, try putting the expression itself in parens with no quotes. Haml syntax recognizes that as an expression.
%g:if(test=(myobj && mysecondObj))
Should resolve to:
<g:if test='<%= (myobj && mysecondObj) %>'></g:if>
Let me know if that helps.
Hello,
thanks for the hack
Unfortunately the result is:
%li(class=(params.controller == 'suppliers' && isAdmin ? 'selected' : ''))
it becomes:
<li class="<%= (params.controller == 'suppliers' && isAdmin ? 'selected' : '') %>">
and in the page I see (using debugbar on firefox):
<li class="<%= (params.controller == 'suppliers' && isAdmin ? 'selected' : '') %>">
and it is not the expected behavior :-/
I have tested around but nothing good :(
Thanks
I've now fixed this in JHaml 0.1.5. Attribute values which look like they have ${}... expression language in them are not escaped.
Haml4Grails 0.4 includes it - you can try out the zipped plugin here: https://github.com/raymyers/haml4grails/tree/master/dist
I'll publish it to the official Grails plugin repo once it's ready.
It's built against Grails 1.3.9, so let me know if there is trouble importing into 2.1.1 - I had some issues getting the dependencies to come through when installing into 2.2.0.
Update: Apparently the dependency strategy for plugins has changed with Grails 2, so I'll have to make some more changes
Another idea for a workaround:
Thanks a lot. I'll try and let u know soon ;)
Hello, I'm using your haml4grails plugin. It saves me ;)
Unfortunately, i have something like this:
it will be converted into
and it make compiler crashes because of
&
So, my question is: how can I avoid this error? I need
and
condition working.Thanks in advance