2
现在我输出3个单选按钮和formtastic。使用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}
可你尝试通过'标签: '
这为整个包装而不是个别部分创建了一个标签/图例。 – 2013-03-05 03:55:10
你可以在你的问题中包含你的formtastic代码吗? – jvnill 2013-03-05 03:55:58