Module: HasMarkup::Markdown::ClassMethods
- Defined in:
- lib/has_markup/markdown.rb
Instance Method Summary collapse
-
#validates_markdown_syntax(*columns) ⇒ Object
Validates the markdown syntax of the given columns.
Instance Method Details
#validates_markdown_syntax(*columns) ⇒ Object
Validates the markdown syntax of the given columns.
27 28 29 30 31 32 33 34 35 |
# File 'lib/has_markup/markdown.rb', line 27 def validates_markdown_syntax(*columns) validates_each(*columns) do |record, column, value| begin record.generate_html_from_markdown(value) rescue BlueCloth::FormatError => e errors.add column, "has #{e}" end end end |