lib/trestle/form/fields/form_group.rb in trestle-0.8.10 vs lib/trestle/form/fields/form_group.rb in trestle-0.8.11
- old
+ new
@@ -14,10 +14,19 @@
concat error_message if errors.any?
end
end
def help_message
- content_tag(:p, options[:help], class: "help-block")
+ classes = ["help-block"]
+
+ if options[:help].is_a?(Hash)
+ message = options[:help][:text]
+ classes << "floating" if options[:help][:float]
+ else
+ message = options[:help]
+ end
+
+ content_tag(:p, message, class: classes)
end
def error_message
content_tag(:p, class: "help-block") do
safe_join([icon("fa fa-warning"), errors.first], " ")