Skip to content

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

@budiljak

Description

@budiljak

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. ;-)

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