Class: TextRenderer
- Inherits:
-
ResourceRenderer::AttributeRenderer::Base
- Object
- ResourceRenderer::AttributeRenderer::Base
- TextRenderer
- Defined in:
- app/attribute_renderers/text_renderer.rb
Instance Attribute Summary
Attributes inherited from ResourceRenderer::AttributeRenderer::Base
Instance Method Summary collapse
Methods inherited from ResourceRenderer::AttributeRenderer::Base
Constructor Details
This class inherits a constructor from ResourceRenderer::AttributeRenderer::Base
Instance Method Details
#display(attribute_name, label, options = {}, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'app/attribute_renderers/text_renderer.rb', line 2 def display(attribute_name, label, = {}, &block) editor_syntax = .delete(:editor_syntax) html_attributes = { id: "#{model.class.name.parameterize}-#{model.to_param}", 'data-add-editor': true } html_attributes[:'data-editor-syntax'] = editor_syntax if editor_syntax.present? h.content_tag(:pre, html_attributes) { value_for_attribute(attribute_name) } end |