0
我有payment_type
模型,保存了3個元素。另外我有一個order
,我想在此存儲payment_type_id
。我寫在訂單視圖:
<%= f.input :pay_type_id, :as => :select, collection: PaymentType.names ...%>
但payment_type_id
已保存爲0.據我所知,我試圖記錄payment_type.name
而不是payment_type.id
。我有什麼要寫在collection:
來解決它?無法整理輸入集合中的數據
謝謝,它的工作原理。 – 2012-04-10 19:06:56