Currently, my form is displaying an error message (Name is a required field) in this format:
However, I want to position the 'can't be blank' error next to the 'Name', like so:
To achieve this layout, I made modifications to the default bootstrap Simple_form classes using the following code snippet:
<%= f.input :name, :required => true, :label_html => { :class => 'edit_form_titles' }, :error_html => { :class => 'cant_be_blank'} %>
The corresponding CSS for these classes looks like this:
.edit_form_titles{
display: block;
margin-bottom: 0px;
color: #333333;
}
.cant_be_blank{
font-size:12px;
}
If anyone has suggestions on how I can align the error message next to the name as mentioned above, I would greatly appreciate it. Thank you!