leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

Question: How do I add a data attribute to a tag within slimbars? #107

Closed Piioo closed 9 years ago

Piioo commented 9 years ago

In Handlebars I can do something like that: <div class="foo" data-bar="{{ id }}"></div> which results in for id 10: <div class="foo" data-bar="10"></div>

How can I do this in slimbars? This doesn't work: .foo data-bar={{ id }} .foo data={id: {{ id }} }

Piioo commented 9 years ago

It works.

.foo data-bar="{{ id }}"