app/models/cardboard/field/rich_text.rb in cardboard_cms-0.2.1 vs app/models/cardboard/field/rich_text.rb in cardboard_cms-0.2.2
- old
+ new
@@ -15,7 +15,11 @@
def sanitize_value
return nil unless value_changed?
self.value = ActionController::Base.helpers.sanitize(self.value, :tags => %w(strong b i u em br p div span ul ol li a pre code blockquote h1 h2 h3), :attributes => %w(class style href src width height alt))
end
+
+ def is_required
+ errors.add(:value, "is required") if required_field? && ActionController::Base.helpers.strip_tags(value_uid).blank?
+ end
end
end
\ No newline at end of file