title: How to do data- attributes with haml and rails?
body: <p>I can have</p>
  
  <pre><code>%a{href: '#', data_toggle_description_length: 'toggle_me_ajax'}
  </code></pre>
  
  <p>which it gives me underscores not dashes, i.e. </p>
  
  <pre><code>&lt;a href="#" data_toggle_description_length="toggle_me_ajax"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>However I want to have <code>HTML5 data-</code> attributes, i.e.</p>
  
  <pre><code>&lt;a href="#" data-toggle-description-length="toggle_me_ajax"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>but when I try replacing underscores with dashes, i.e.</p>
  
  <pre><code>%a{href: '#', data-toggle-description-length: 'toggle_me_ajax'}
  </code></pre>
  
  <p>I get syntax errors:</p>
  
  <pre><code>/home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: syntax error, unexpected tLABEL
  ...data-toggle-description-length: 'toggle_me_ajax')}&gt;\n    tog...
  ...                               ^
  /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: syntax error, unexpected ')', expecting '}'
  ...ption-length: 'toggle_me_ajax')}&gt;\n    toggleMeAjax\n  &lt;/a&gt;\...
  ...                               ^
  /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: unknown regexp options - pa
  /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: syntax error, unexpected $undefined
  ... toggleMeAjax\n  &lt;/a&gt;\n&lt;/span&gt;\n", -1, false);::Haml::Util.h...
  ...                               ^
  /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: unterminated string meets end of file
  /home/durrantm/Dropnot/webs/rails_apps/linker/app/views/links/_links.html.haml:13: syntax error, unexpected $end, expecting '}'
  </code></pre>