Class: Administrate::Field::SimpleMarkdown
- Inherits:
-
Text
- Object
- Text
- Administrate::Field::SimpleMarkdown
- Defined in:
- lib/administrate/field/simple_markdown.rb
Defined Under Namespace
Classes: Engine
Instance Method Summary collapse
Instance Method Details
#data ⇒ Object
15 16 17 |
# File 'lib/administrate/field/simple_markdown.rb', line 15 def data @data || '' end |
#easymde_options ⇒ Object
19 20 21 22 23 |
# File 'lib/administrate/field/simple_markdown.rb', line 19 def .fetch(:easymde_options, {}) .transform_keys { |key| key.to_s.camelize(:lower) } .to_json end |
#html_id ⇒ Object
33 34 35 36 37 38 |
# File 'lib/administrate/field/simple_markdown.rb', line 33 def html_id [ resource.class.name.underscore.gsub('/', '_'), attribute ].join('_') end |
#to_html ⇒ Object
25 26 27 |
# File 'lib/administrate/field/simple_markdown.rb', line 25 def to_html markdown(html_renderer).render(data).html_safe end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/administrate/field/simple_markdown.rb', line 29 def to_s markdown(plaintext_renderer).render(data) end |