Skip to content
Browse files

Merge pull request #87 from mjbellantoni/fix_form_errors

Fixes error validation states.
  • Loading branch information...
2 parents 6758345 + 7b91c8e commit 0804377f38ce135aa840853291b26711d200acfd @mjbellantoni committed Nov 27, 2013
View
2 VERSION
@@ -1 +1 @@
-3.0.0.rc.1
+3.0.0.rc.2
View
4 lib/formtastic-bootstrap/helpers/errors_helper.rb
@@ -53,9 +53,9 @@ def semantic_errors(*args)
return nil if full_errors.blank?
if html_options[:class].blank?
- html_options[:class] = "alert alert-error"
+ html_options[:class] = "alert alert-danger"
else
- html_options[:class] = "alert alert-error " + html_options[:class]
+ html_options[:class] = "alert alert-danger " + html_options[:class]
end
template.content_tag(:div, html_options) do
View
1 lib/formtastic-bootstrap/inputs/base/labelling.rb
@@ -10,6 +10,7 @@ def label_html_options
# Bootstrap defines class 'label' too, so remove the
# one that gets created by Formtastic.
options[:class] = options[:class].reject { |c| c == 'label' }
+ options[:class] << " control-label"
end
end
View
1 lib/formtastic-bootstrap/inputs/base/wrapping.rb
@@ -46,6 +46,7 @@ def form_group_wrapping(&block)
def wrapper_html_options
super.tap do |options|
options[:class] << " form-group"
+ options[:class] << " has-error" if errors?
end
end
View
2 lib/formtastic-bootstrap/version.rb
@@ -1,3 +1,3 @@
module FormtasticBootstrap
- VERSION = "3.0.0.rc.1"
+ VERSION = "3.0.0.rc.2"
end

0 comments on commit 0804377

Please sign in to comment.
Something went wrong with that request. Please try again.