how to change class of a label for checkboxes in simple_form

前端 未结 6 891
说谎
说谎 2020-12-14 15:49

using simple_form we can change class of a label using:

label_html => {:class => \"myclass\"}

but how do we do the same when

6条回答
  •  孤城傲影
    2020-12-14 16:02

    This should be pretty straight forward like mentioned above one should add :label_html => { :class => "myclass" } in order achieve this, for instance:

    = f.input :remember_me, as: :boolean, :input_html => { :class => 'kt-checkbox kt-mock-span' }, :label_html => { :class => "kt-login-checkbox-label" }

    will create and assign the attributes for the styles on the checkbox's label like this:

提交回复
热议问题