I have a list of elements, which should create or delete a record in a table when clicked. Each element has some data attributes associated with it to create/destroy the correct record. I am wondering the correct 'rails' way to accomplish this?
Element list:
<div>
<h3 data-date="2016-06-11 09:00:00 UTC" data-swimmer-id="1">Lisa</h3>
<h3 data-date="2016-06-11 09:00:00 UTC" data-swimmer-id="2">Karen</h3>
<h3 data-date="2016-06-11 09:00:00 UTC" data-swimmer-id="3">Susan</h3>
<h3 data-date="2016-06-11 09:00:00 UTC" data-swimmer-id="4">Liz</h3>
</div>