[問題] 驗證問題

看板Ruby作者 (I love you ,L)時間12年前 (2011/10/12 15:38), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
環境: Ruby 1.8.6 Rails 2.3.9 狀況: 我在form的驗證中使用了validates_presence_of :title 結果我在此表單中有另外一個select的function(select中的內容都正常) 如果是正常送出有值的資料都能正常寫入資料庫 如果我故意把title輸入值處空白要讓它顯示error message的時候 它反而不會正常顯示 結果跑出這個 You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.collect 請問這是什麼原因 如果我把select拿掉就能正常顯示了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.120.1.136
文章代碼(AID): #1EbKFkpY (Ruby)