0
@@ -18,13 +18,23 @@ module AwesomeFields
0
# When producing a field, the field is wrapped with a div whose CSS class is
0
# +form_line+. If the field has errors, that class is instead
0
- #
+form_line_with_errors+. This div is, obviously, a block-level element by
0
+ #
<tt>form_line with_errors</tt>. This div is, obviously, a block-level element by
0
# default, but can be floated or what have you if needed.
0
# As mentioned above, if the field has an error, the wrapping div is given the
0
- # +form_line_with_errors+ CSS class instead of the regular +form_line+ class.
0
+ # <tt>form_line with_errors</tt> CSS class instead of the regular +form_line+ class.
0
+ # Recommended CSS looks something like:
0
+ # form div.form_line {
0
+ # ... font, padding, margin, etc.
0
+ # form div.form_line.with_errors {
0
+ # color: red; <!-- additional formatting for error fields -->
0
# Additionally, the error text is placed within the containing +form_line+ div
0
# within its own div, whose class is +field_error+.
0
@@ -39,7 +49,7 @@ module AwesomeFields
0
# The resulting structure of a field with errors is:
0
- # <div class="form_line
_with_errors">
0
+ # <div class="form_line
with_errors">
0
# <div class="field_error">Field should not be blank.</div>
0
# <label for="model_field">Field:</label>
0
@@ -127,7 +137,7 @@ module AwesomeFields
0
@template.content_tag( 'div',
0
(err ? err : '') + label_tag( label, options ) +
0
- :class => err ? 'form_line
_with_errors' : 'form_line' )
0
+ :class => err ? 'form_line
with_errors' : 'form_line' )
0
# Produces a submit button wrapped in a div of class +form_buttons+. The
0
@@ -151,7 +161,7 @@ module AwesomeFields
0
@template.content_tag 'div',
0
(err ? err : '') + label_tag(attr, options) + content_gen.call + after,
0
- :class => (err ? 'form_line
_with_errors' : 'form_line')
0
+ :class => (err ? 'form_line
with_errors' : 'form_line')
0
# Produces the appropriate label tag for the given attribute, including
Comments
No one has commented yet.