2

现在我正在输出 3 个带有 formtastic 的单选按钮。

<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 回答