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