I am using the client_side_validations gem. How do you suggest getting this to work with 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
en开发者_JAVA技巧d
= form_for @motorcycle, :validate => true do |f|
= f.text_field :year
= f.text_field :drive_type
Outputs:
<input id='motorcylce_year' type='text' \>
<input data-validate='true' id='motorcylce_drive_type' type='text' \>
Interesting. This might be a bug. Can you please open an issue on Github?
精彩评论