HAML。 form_for中的下拉列表

时间:2013-06-06 09:39:49

标签: ruby-on-rails haml form-for

我在尝试:

= form_for @question do |w|
  %p
    = w.select "question_status"
    %option{:value => 1}= "label 1"
    %option{:value => 2}= "label 2"

但得到:错误的参数数量(1对2)

1 个答案:

答案 0 :(得分:0)

= form_for @question do |w|
  %p
    = w.select 'question_status', [['label 1', 1], ['label 2', 2]]