0
= form_for @question do |w|
%p
= w.select "question_status"
%option{:value => 1}= "label 1"
%option{:value => 2}= "label 2"
,但得到:錯誤的參數數目(1 2)[HAML的
= form_for @question do |w|
%p
= w.select "question_status"
%option{:value => 1}= "label 1"
%option{:value => 2}= "label 2"
,但得到:錯誤的參數數目(1 2)[HAML的
= form_for @question do |w|
%p
= w.select 'question_status', [['label 1', 1], ['label 2', 2]]
спасибобольшое:) –
可能重複。形式\ _for。 dropdowsn list](http://stackoverflow.com/questions/16956429/haml-form-for-dropdowsn-list) – matt