2

現在、formtasticで3つのラジオボタンを出力しています。

<label for="exercise_log_entries_attributes_0_difficulty_medium">
 <input checked="checked" class="custom radio" data-placeholder="Difficulty" id="exercise_log_entries_attributes_0_difficulty_medium" name="exercise[log_entries_attributes][0][difficulty]" type="radio" value="Medium">
 Medium
</label>

「中」をカスタムクラスでラップしたい。これどうやってするの?

答えを見つけました:

使用する必要がありますmember_label

member_label: Proc.new {|a| "<span class='custom radio'>#{a}</span>".html_safe}
4

1 に答える 1

1

理解した:

member_label: Proc.new {|a| "<span class='custom radio'>#{a}</span>".html_safe}
于 2013-03-05T04:02:26.807 に答える