Class: Effective::TableRows::ArticleEditor

Inherits:
Effective::TableRow show all
Defined in:
app/models/effective/table_rows/article_editor.rb

Instance Attribute Summary

Attributes inherited from Effective::TableRow

#builder, #name, #options, #template

Instance Method Summary collapse

Methods inherited from Effective::TableRow

#controller_namespace, #hint, #initialize, #label_content, #to_html, #tr_class, #value

Constructor Details

This class inherits a constructor from Effective::TableRow

Instance Method Details

#contentObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/effective/table_rows/article_editor.rb', line 7

def content
  return unless value.present?

  value_to_s = value.to_s

  if value_to_s.include?('</')
    value_to_s.html_safe
  else
    template.simple_format(value_to_s)
  end
end

#labelObject

Humanized label or the label from form



20
21
22
23
24
25
# File 'app/models/effective/table_rows/article_editor.rb', line 20

def label
  text = options[:label] || EffectiveResources.et(builder.object, name).sub(/^Rich text /, '').capitalize
  prefix = builder.options[:prefix]

  [*prefix, text].join(': ')
end