Sha256: e3bfeb40a52bffbe903ac70737bb59c654a1eb635817e10280c27ff9a20153f0

Contents?: true

Size: 429 Bytes

Versions: 6

Compression:

Stored size: 429 Bytes

Contents

module ContentsCore
  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.permitted_attributes
      [ :data_text ]
    end

    def self.type_name
      'text'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
contents_core-0.2.5 app/models/contents_core/item_text.rb
contents_core-0.2.4 app/models/contents_core/item_text.rb
contents_core-0.2.2 app/models/contents_core/item_text.rb
contents_core-0.2.0 app/models/contents_core/item_text.rb
contents_core-0.1.9 app/models/contents_core/item_text.rb
contents_core-0.1.8 app/models/contents_core/item_text.rb