我使用sorcery進行身份驗證以及twitter bootstrap。如何更改默認導軌錯誤分區「field_with_errors」
我想通過更改添加到DOM的默認導軌<div class="field_with_errors">
來在我的註冊表單中設置我的錯誤消息的樣式。
什麼是這樣做的軌道公約?
我想你可以添加一些JavaScript來操縱DOM重命名<div class="field_with_errors">
,但這似乎是一個黑客攻擊。似乎應該有一種方法來覆蓋這在軌道,但我不知道在哪裏做的。
這是自舉如何要求您將錯誤使用其內置的形狀誤差風格標記:
<div class="control-group error">
<label class="control-label" for="inputError">Input with error</label>
<div class="controls">
<input type="text" id="inputError">
<span class="help-inline">Please correct the error</span>
</div>
</div>
我認爲你正在尋找這個
HTTP ://stackoverflow.com/questions/5267998/rails-3-field-with-errors-wrapper-changes-the-page-appearance-how-to-avoid-t – Prem
@prem:謝謝!即將鏈接到我自己。 –