diff --git a/_includes/forms.html b/_includes/forms.html index 3e526e4..d5813de 100644 --- a/_includes/forms.html +++ b/_includes/forms.html @@ -515,6 +515,23 @@

Errors

{% endhighlight %} +

Note that fields inside fields_for submitted with invalid values are not automatically highlighted. The :errors options should be specified explicity so that BH recognizes the :errors options.

+ {% highlight rhtml %} +<%= f.fields_for :company, fields_set: false, errors: {icons: true, messages: true} do |company_form| %> + <%= company_form.text_field :name %> +<% end %> + {% endhighlight %} +

However, error messages in the association attribute should still be displayed manually.

+ {% highlight rhtml %} +<% if @user.company.errors.any? %> + +<% end %> + {% endhighlight %} +

Help text

Use the :help option to display a help message after fields inside bootstrapped forms.

Note that error messages will have precedence over help messages.