Module: MarkupAttr::ActiveRecord::ClassMethods

Defined in:
lib/markup_attr/active_record.rb

Instance Method Summary collapse

Instance Method Details

#markup_attr(attribute, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/markup_attr/active_record.rb', line 15

def markup_attr(attribute, options = {})
  self.markup_attr_options ||= {}
  self.markup_attr_options[attribute] = options.reverse_merge(
    :sanitize   => true,
    :attributes => %w[title id href alt href],
    :tags       => %w[p ul ol li strong em a code pre]
  )

  before_save :convert_content_for_markup_attributes
end