Class: Tags::ActionText

Inherits:
Base
  • Object
show all
Includes:
Placeholderable
Defined in:
app/helpers/action_text/tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#editable_valueObject



51
52
53
# File 'app/helpers/action_text/tag_helper.rb', line 51

def editable_value
  value&.body.try(:to_trix_html)
end

#renderObject



44
45
46
47
48
49
# File 'app/helpers/action_text/tag_helper.rb', line 44

def render
  options = @options.stringify_keys
  add_default_name_and_id(options)
  options["input"] ||= dom_id(object, [options["id"], :trix_input].compact.join("_")) if object
  @template_object.rich_text_area_tag(options.delete("name"), editable_value, options)
end