Woops! . - .
... no copy-paste. , , , , , (, -, ).
, - , ! , ! ?!
, . , , input.id label.for html. :
<%= f.radio_button :bet_type, "moneyline" %>
<%= f.label :moneyline, "Moneyline" %>
:
<input id="bet_type_moneyline" name="bet_type type="radio" value="moneyline" />
<label for="moneyline">Moneyline</label>
, input.id label.for ?
And only when I ran the code in my question did I get it right.
It seems to work like this: the radio button tag method makes input.id (object_name + "_" + value), and the label label method makes label.for object_name from it. And when these two are equal, you get a shortcut of choice.
I hope this discovery can help someone else get out of line.
Sorry for the fact that your gears don't do anything either!
source
share