此代码是否等效
class Product < ActiveRecord::Base
validates :legacy_code, :format => { :with => /\A[a-zA-Z]+\z/,
:message => "Only letters allowed" }
end
到这段代码:
class Product < ActiveRecord::Base
validates :legacy_code, format: { with:/\A[a-zA-Z]+\z/,
message:"Only letters allowed" }
end
??