how to change class of a label for checkboxes in simple_form

前端 未结 6 883
说谎
说谎 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条回答
  •  萌比男神i
    2020-12-14 16:16

    If you want you can pass new_class to the label doing something like:

    <%= f.collection_check_boxes attribute, collection, value_method, text_method do |b| 
          b.label(class: 'new_class') {b.check_box + b.text}
    end %>
    

提交回复
热议问题