2011-08-04 124 views
1

我正在使用client_side_validations gem。你如何建議讓這個與STI合作?客戶端驗證和STI

class Vehicle < ActiveRecord::Base 
    validates :year, :presence => true 
end 

class Car < Vehicle 
    validates :cylinders, :presence => true 
end 

class Motorcycle < Vehicle 
    validates :drive_type, :presence => true 
end 

= form_for @motorcycle, :validate => true do |f| 
    = f.text_field :year 
    = f.text_field :drive_type 

輸出:

<input id='motorcylce_year' type='text' \> 
<input data-validate='true' id='motorcylce_drive_type' type='text' \> 
+0

STI不是問題......我糾正了。 – efoo

+0

下面列出的Github問題在這裏:https://github.com/bcardarella/client_side_validations/issues/154 – jakeonrails

回答

0

有趣。這可能是一個錯誤。你可以在Github上打開一個問題嗎?