You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%a{:href=>"/posts", :data => {:author_id => 123}} Posts By Author
given in the reference produces
<a data-author_id='123' href='/posts'>Posts By Author</a>
This markup is hideously ugly with the underscore—the data attribute should be named data-author-id. Since HAML isn’t substituting hyphens for the underscores automatically, there doesn’t really seem to be any advantage to using the special :data attribute key over just doing
%a{:href=>"/posts", 'data-author-id' => 123} Posts By Author
Using the :data key is more typing and you still end up having a string hash key for the attribute anyways:
%a{:href=>"/posts", :data => {'author-id' => 123}} Posts By Author
What’s the point?
The text was updated successfully, but these errors were encountered:
This is a feature request rather than a bug.
The example
given in the reference produces
This markup is hideously ugly with the underscore—the data attribute should be named
data-author-id
. Since HAML isn’t substituting hyphens for the underscores automatically, there doesn’t really seem to be any advantage to using the special:data
attribute key over just doingUsing the
:data
key is more typing and you still end up having a string hash key for the attribute anyways:What’s the point?
The text was updated successfully, but these errors were encountered: