How to keep a checkbox and label on the same line in a Rails form?

后端 未结 14 1512
天涯浪人
天涯浪人 2021-02-03 17:34

What should I do to keep the label of a checkbox on the same line with the checkbox in a rails view containing a form?

Currently the label goes on the next line:

<
14条回答
  •  情话喂你
    2021-02-03 18:15

    On Rails 5.2, ruby 2.4 and bootstrap 4.1.1:

    <%= form.check_box :terms_of_service, label: "your custom label...."%> 
    

    worked for me without having to indicate inline checkbox.

提交回复
热议问题