0
這是一個代碼a * helper.rb。而不是這3種方法(它們是完美的工作)Ruby on Rails中的助手方法不起作用,因爲我需要
def years_of_birth_select(form)
form.select :year_of_birth, (1..31).to_a
end
def months_of_birth_select(form)
form.select :month_of_birth, months
end
def days_of_birth_select(form)
form.select :day_of_birth, years
end
我試着打電話給只有一個方法
def date_of_birth_select(form)
form.select :day_of_birth, years
form.select :month_of_birth, months
form.select :year_of_birth, (1..31).to_a
end
,它被稱爲是
= date_of_birth_select f
而且只一個顯示選擇,:year_of_birth
,選擇。
我做錯了什麼,我該怎麼做才能正確呼叫date_of_birth_select
?