Can anyone offer an opinion on whether it's better to use the Rails conventions provided in the dom_class
and dom_id
attributes for semantic helpers like div_for
rather than HTML5 data-attributes like 'data-class' or 'data-id'?
ie:
<div id="post_550" class="post">
vs
<div data-class="post" data-id="550">
Just one opinion...
That way, your presentation stuff is one place, and your data stuff another. You can always mix/match too in your selectors if needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With