Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在块的表单_中生成单选按钮表单?_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 如何在块的表单_中生成单选按钮表单?

Ruby on rails 如何在块的表单_中生成单选按钮表单?,ruby-on-rails,ruby,Ruby On Rails,Ruby,我知道如何使用以下命令循环组合框: <%= f.collection_select(:category_id , Category.all, :id, :name, {:prompt => false})%> 但是如何在表单助手中执行此操作?谢谢。没有 <%= f.radio_button :receive_newsletter, "yes" %> 工作?不行 <%= f.radio_button :receive_newsletter, "yes"

我知道如何使用以下命令循环组合框:

<%= f.collection_select(:category_id , Category.all, :id, :name, {:prompt => false})%> 
但是如何在表单助手中执行此操作?谢谢。

没有

<%= f.radio_button :receive_newsletter, "yes" %>

工作?

不行

<%= f.radio_button :receive_newsletter, "yes" %>

工作