Radio buttons on Rails

后端 未结 5 892
迷失自我
迷失自我 2020-12-12 19:08

Similar to this question: Checkboxes on Rails

What\'s the correct way of making radio buttons that are related to a certain question in Ruby on Rails? At the moment

5条回答
  •  死守一世寂寞
    2020-12-12 19:40

    Hmm, from the docs I don't see how you can set the ID on the radio buttons... the label's for attribute tries to link to the ID on the radio.

    rails docs for radio_button_tag

    That said, from the doc, that first param is the "name"... which if that is what it is creating, should group them alltogether. If not, maybe its a bug?

    Hmm, wonder if these have been fixed: http://dev.rubyonrails.org/ticket/2879 http://dev.rubyonrails.org/ticket/3353

提交回复
热议问题