JSFiddle - React, Tailwind, and code Playground

HTML

<table>
<tr>
            <td>NC</td>
            <td><%= @subscriptions.where("users.ranking = 'NC'").count %></td>
            <td><input type="checkbox" name="my-checkbox" class="checkbox-ranking" id="bite" data-size='small'></td>
          </tr>
          <tr>
            <td>40</td>
            <td><%= @subscriptions.where("users.ranking = '40'").count %></td>
            <td><input type="checkbox" name="my-checkbox" class="checkbox-ranking" data-size='small' ></td>
          </tr>
          <tr>
            <td>30/5</td>
            <td><%= @subscriptions.where("users.ranking = '30/5'").count %></td>
            <td><input type="checkbox" name="my-checkbox" class="checkbox-ranking" data-size='small' ></td>
          </tr>
              </table>

JavaScript

$(document).ready(function(){
    $('.checkbox-ranking').on('change', function() {
var rankings = $('.checkbox-ranking:checked').map(function() {
        return $(this).parent().parent().find('td:first-child').html();
        }).get().join(',');
alert(rankings);
      
    });
  });