Skip to content

Error messages don't display on form_group #655

@suketk

Description

@suketk

I have a set of radio buttons in my form group that don't show error messages.

When there is an error, the radio buttons and respective labels turn red, but there's no message.

I can confirm there's an error because the error summary prints it, but it's not displayed by the field.

If I use errors_on, the .invalid-feedback div appears in the DOM but it's hidden because there's no CSS rule (in Bootstrap?) that matches it.

I believe this is a bug, unless I'm missing something simple.

Example below:

The associated model has a presence validation for the :test field.

<%= f.form_group :test, label: {text: 'Label'}, help: 'Help', class: 'mb-5 linear' do %>

  <%= f.radio_button :test, 1, label: 1, inline: true %>
  <%= f.radio_button :test, 2, label: 2, inline: true %>
  <%= f.radio_button :test, 3, label: 3, inline: true %>

<% end %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions