Sha256: 04e4af1202d1c1133ba42b6e71e0137ba8d0764a2a97ab78ffe4dd3e9dde30e2
Contents?: true
Size: 536 Bytes
Versions: 53
Compression:
Stored size: 536 Bytes
Contents
module Para module AttributeField class Redactor < AttributeField::Base include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::TextHelper register :redactor, self def initialize(model, options = {}) options.reverse_merge!(type: 'text', field_type: 'redactor') super(model, options) end def value_for(instance) (value = instance.send(name)) && truncate( sanitize(value, tags: []), length: 50 ) end end end end
Version data entries
53 entries across 53 versions & 1 rubygems