Class: Proscenium::UI::Form::Fields::RichTextarea

Inherits:
Base show all
Defined in:
lib/proscenium/ui/form/fields/rich_textarea.rb

Instance Attribute Summary

Attributes inherited from Base

#attribute, #attributes, #form, #model

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods inherited from Phlex

inherited, sideload_assets

Methods included from Phlex::AssetInclusions

#include_assets, #include_javascripts, #include_stylesheets

Methods included from Phlex::CssModules

#after_template, #before_template, included, #process_attributes

Methods included from CssModule

#class_names, #css_module

Methods included from SourcePath

included

Constructor Details

This class inherits a constructor from Proscenium::UI::Form::Fields::Base

Instance Method Details

#view_templateObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/proscenium/ui/form/fields/rich_textarea.rb', line 7

def view_template
  value = attributes.delete(:value)

  field do
    label
    trix_editor input: field_id
    hint
    form.hidden_field(*attribute, id: field_id, value: value&.to_trix_html)
  end
end