I'm using sorcery for authentication along with twitter bootstrap.
I'd like to style my error messages on my signup form in the style of twitter's bootstrap by changing the default rails <div class="field_with_errors">
that gets added to the DOM.
What's the rails convention for doing something like this?
I suppose you could add some javascript that manipulates the DOM to rename <div class="field_with_errors">
, but that seems like a hack. It seems like there should be a way to override this in rails, but I can't figure out where to do that.
This is how bootstrap requires you to mark up your error to use its built in form error styles:
<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 Sep 03 '12 at 18:25