如何在简单形式的gem中使用collection_radio_buttons获取空白单选按钮选项?

时间:2013-03-01 19:26:10

标签: ruby-on-rails radio-button simple-form

我在rails视图中使用了这段代码,它使用了简单形式的gem:

<%= simple_form_for :beta_signup, :url => url_for(:action => 'update', :controller => 'survey'), :html => { :id => 'info-form' } do |beta_signup| %>
<%=   beta_signup.collection_radio_buttons :this_excited, [[0,'Not really excited at all'], [1,''], [2, ''], [3, ''], [4, 'Super Excited!!']], :first, :last, :checked => 2, required: false %>
<% end %>

而不是显示中间单选按钮的空白,它显示“This excited 1”,“This excited 2”,“This excited 3”。有没有办法让中间3个单选按钮显示没有标签?

输入“”不起作用(显示“兴奋1”),“”和“\ t”不起作用(分别显示“”和“\ t”)。

0 个答案:

没有答案