simple_form renders radio buttons incorrectly

后端 未结 3 653

Using simple_form I render some radio buttons to select Gender on registration page.

code:

        = f.input :gender,
              :collection =>         


        
3条回答
  •  猫巷女王i
    2021-01-15 18:38

    Have you tried to simply create or sort the collection in the order which you want?

    Somethink like this :

    = f.input :gender,
        :collection => gender.reverse,
        :as => :radio_buttons,
        :item_wrapper_class => 'inline'
    

    Obviously, this is not the better solution. You should create the list in the right order.

提交回复
热议问题