mercredi 18 novembre 2015

How to remove last element from checkbox

I want to remove the last checkbox option from this loop.

- StandardSize.all.each do |s|
   = f.check_box :standard_sizes_id_in, {multiple: true}, s.id, nil
   = s.name

This is how I get the checkbox option, when I did inspect element. From here I want to remove 'custom size' option (which is the last checkbox name). How to do so?

<input type="checkbox" value="1" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_1">S
<input type="checkbox" value="2" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_2">M
<input type="checkbox" value="3" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_3">L
<input type="checkbox" value="4" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_4">XL
<input type="checkbox" value="5" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_5">XXL
<input type="checkbox" value="10" name="q[standard_sizes_id_in][]" id="q_standard_sizes_id_in_10">Custom Size

Aucun commentaire:

Enregistrer un commentaire