Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Overriding form tag's 'control_col' not working for f.check_box (layout: :horizontal) #722

Open
budiljak opened this issue Feb 1, 2024 · 0 comments

Comments

@budiljak
Copy link

budiljak commented Feb 1, 2024

Hi.

In the last update your added magic .offset-col-X for the check boxes in bootstrap forms with horizontal layout - which is cool. It derives an offset by the label_col setting for the form tag.

BUT in certain forms I need to override this:

f.check_box :ausgeblendet, label_col: "", control_col: "col-sm-12"

By setting label_col to nothing ("") the offset is removed - as expected.
But unfortunately

control_col: "col-sm-12"

doesn't work and the class for the surrounding div stays as given in den form tag. E.g. if I define the form with control_col: "col-sm-10" this class is used for the surrounding div. No matter what option I add to the check_box .

EDIT:
Maybe inline: true should do what I wan't?! But it also doesn't. There's

Cheers and thanks for the gem!
Ben

PS: For anyone having the same issue, you can workaround this by setting the optionlabel_class: "text-nowrap". So the label text is written into the following empty space. ;-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant