Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected:
- def validate
- bc = BlueCloth.new(your_markdown_string_attribute)
- begin
- bc.to_html
- rescue
- errors.add(:your_markdown_string_attribute, 'has invalid markdown syntax')
- end
- end
- begin
- require "rdiscount"
- BlueCloth = RDiscount
- rescue LoadError
- # BlueCloth is still the our fallback,
- # if RDiscount is not available
- require 'bluecloth'
- end
Add Comment
Please, Sign In to add comment