4
我有2個字段,即mobile_no
和telephone_no
。我想驗證此字段的條件如下:Rails - 驗證參數取決於其他參數
If mobile_no is present on submit, then
don't validate telephone_no
if telephone_no is present on submit, then
don't validate mobile_no
我該怎麼做?
http://stackoverflow.com/questions/6273289/validate-presence-of-field-only-if-another-field-is-blank -rails – webster
感謝您的鏈接。 :) – BartSabayton