Describe the bug
When a mongoid document has an embedded class the boolean selector doesn't work on new or edit
Reproduction steps
Create mongoid class with embedded document
Embedded document needs to have a Mongoid::Boolean field
Add the embedded document in accepts_nested_attributes_for
Open edit or create for the parent document in rails admin
Clicking any of the buttons for the boolean won't change your selection
Expected behavior
Clicking the buttons will change the selection
Additional context
Digging into the html it seems to be that the label field has an incorrect for value:
What rails admin creates:
<input class="btn-check" type="radio" value="1" name="parent_class[embedded_class_attributes][field_name]" id="parent_class_embedded_class_attributes_field_name_1">
<label for="parent_class[embedded_class_attributes]_field_name_1" class="success btn btn-outline-success">
<span class="fas fa-check"></span>
</label>
What it should be:
<input class="btn-check" type="radio" value="1" name="parent_class[embedded_class_attributes][field_name]" id="parent_class_embedded_class_attributes_field_name_1">
<label for="parent_class_embedded_class_attributes_field_name_1" class="success btn btn-outline-success">
<span class="fas fa-check"></span>
</label>
manually updating that label tag for attribute via admin tools fixes the problem.
rails version: 6.1.6.1
rails_admin version: 3.0.0
mongoid version: 7.5.1
Describe the bug
When a mongoid document has an embedded class the boolean selector doesn't work on new or edit
Reproduction steps
Create mongoid class with embedded document
Embedded document needs to have a Mongoid::Boolean field
Add the embedded document in accepts_nested_attributes_for
Open edit or create for the parent document in rails admin
Clicking any of the buttons for the boolean won't change your selection
Expected behavior
Clicking the buttons will change the selection
Additional context
Digging into the html it seems to be that the label field has an incorrect for value:
What rails admin creates:
What it should be:
manually updating that label tag for attribute via admin tools fixes the problem.
railsversion: 6.1.6.1rails_adminversion: 3.0.0mongoidversion: 7.5.1