Sha256: a63b32995ebeeb9dbca1c5f511a21611ce47ab2e48ad487ccdb0fb450d2a010d

Contents?: true

Size: 371 Bytes

Versions: 5

Compression:

Stored size: 371 Bytes

Contents

module EditableComponents
  class ItemText < Item
    alias_attribute :data, :data_text

    def init
      self.data = self.name.gsub( /-/, ' ' ).humanize
      self
    end

    def update_data( value )
      self.data = ActionController::Base.helpers.sanitize( CGI.unescapeHTML( value ) )
      self.save
    end

    def self.type_name
      'text'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
editable_components-0.1.6 app/models/editable_components/item_text.rb
editable_components-0.1.4 app/models/editable_components/item_text.rb
editable_components-0.1.3 app/models/editable_components/item_text.rb
editable_components-0.1.2 app/models/editable_components/item_text.rb
editable_components-0.1.0 app/models/editable_components/item_text.rb