anchor.diff:      //   selected="selected"
       //   value='4'
   
  -    newRow[0].removeAttribute('id');
  +    newRow[0].setAttribute('id', 'recipe-ingredient-id-');
   
       var selectElems = newRow.find('select');
       selectElems[0].setAttribute('name', newName + '[ingredient_id]');
  
positive.code:     });
  
      ingredientTable.append(newRow);
      e.preventDefault();
    }
  
  
negative.code:     var newRow   = ingredientTable.find('tr:first').clone();
      var newRowId = ingredientTable.find('tr').length;
      var newId   = `recipe_recipe_ingredients_attributes_${newRowId}_`;
      var newName = `recipe[recipe_ingredients_attributes][${newRowId}]`;
  
      // These are the attributes that need to be edited when cloning a table row.
      // The index values need updating to a new, unique, value -
  