`
beiersi
  • 浏览: 75229 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

bootstrap + simple_form 的 check_boxes inline样式

    博客分类:
  • ruby
 
阅读更多

使用simple_form默认的bootstrap wrapper,默认输出的check_boxes是竖排,要想改成横排,需要在checkbox表单之外的label加上inline样式。使用 :item_wrapper_class => :inline 即可。如下:

 

<%= f.association :roles, :as => :check_boxes, :item_wrapper_class => :inline %>

 

我在simple_form的github页面上居然没找到 :item_wrapper_class 这个东西,google之后发现simple_form的github的讨论页面 https://github.com/plataformatec/simple_form/issues/479有人提到。记录在此免得以后忘了。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics