simple_form_for rails radio button inline

后端 未结 6 1342
半阙折子戏
半阙折子戏 2021-01-30 23:26

I am trying to get my buttons to display inline and also have a default value because it can\'t be blank. I am usingplataformatex/simple_form and bootstrap.

= f.         


        
6条回答
  •  臣服心动
    2021-01-30 23:41

    You can try

    f.collection_radio_buttons :options, [[true, 'Yes'] ,[false, 'No']], :first, :last ,:style =>"display:inline", :default => true
    

    Not so sure which gem you use for simple form , but This is the source or a reference on which you can try

    collection_radio_buttons(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block)
    

提交回复
热议问题