single quotes nested in double quotes

63 views
Skip to first unread message

bert bruynooghe

unread,
Mar 23, 2012, 6:53:20 AM3/23/12
to Haml
How do I produce HAML for this:
<div data-bind="attr: { 'data-something': someValue }">...</div>

Next line replaces all quotes by double quotes, rendering the result
unusable:
%div{'data-bind' => "attr{'data-something' : someValue}"}

Kind regards,
Bert Bruynooghe.

kadoudal

unread,
Mar 25, 2012, 1:11:27 PM3/25/12
to Haml
did you try :

%div{:'data-bind' => "attr: { 'data-something': someValue }"}

On Mar 23, 12:53 pm, bert bruynooghe <bert.bruynoo...@gmail.com>
wrote:

bert bruynooghe

unread,
Mar 26, 2012, 3:39:25 AM3/26/12
to ha...@googlegroups.com
Sorry, I forgot the semicolumn in the example I posted. Anyway, I got
the same result, it still produces:
<div data-bind="attr: { " data-something': somevalue }'></div>

(If I copy and paste directly from Chrome, I even got:
<div data-bind="attr: { " data-something':="" somevalue="" }'=""></div>,
but I suspect this to be a Chrome issue.)

FYI: I am doing this from a Ruby (1.9.3) on Rail (3.2.2) project, using
haml_assets (0.1.0).

Kind regards,
Bert Bruynooghe.


On Mon, Mar 26, 2012 at 9:36 AM, bert bruynooghe
<bert.br...@gmail.com> wrote:

> Soory, I forgot the semicolumn in the example I posted. Anyway, I got the
> same result, it still produces:
>
> <div data-bind="attr: { " data-something': somevalue }'></div>
>
> (If I copy and paste directly from  Chrome, I even got:
> <div data-bind="attr: { " data-something':="" somevalue="" }'=""></div>,
> but I suspect this to be a Chrome issue.)
>
> FYI: I am doing this from a Ruby (1.9.3) on Rail (3.2.2) project, using
> haml_assets (0.1.0).
>
> Kind regards,
> Bert Bruynooghe.
>

bert bruynooghe

unread,
Mar 30, 2012, 5:29:05 AM3/30/12
to ha...@googlegroups.com
I figured out this is in fact a problem of haml_assets 0.1.0. It seems to work in regular RoR as expected.

Op vrijdag 23 maart 2012 11:53:20 UTC+1 schreef bert bruynooghe het volgende:
Reply all
Reply to author
Forward
0 new messages