I rated Slim as a replacement for HAML in a personal project, and it doesn't seem to handle HTML5 data attributes as elegantly as HAML. I was hoping that someone might also come across this, or perhaps know about a parameter / syntax that I have not yet found in my docs.
HAML allows you to define HTML 5 data attributes by simply using nested hashes:
%a{data: {key1: 'val', key2: 'val'}}
resulting in
<a data-key1='val' data-key2='val'></a>
ruby ruby-on-rails templating haml slim-lang
mmoss Sep 22 '13 at 19:42 2013-09-22 19:42
source share