Module: Maglev::Form::Inputs::Richtext
- Defined in:
- app/lib/maglev/form/inputs/richtext.rb
Instance Method Summary collapse
- #richtext(method, options = {}) ⇒ Object
- #richtext_component_html_options(options) ⇒ Object
- #richtext_component_options(method, options) ⇒ Object
Instance Method Details
#richtext(method, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/lib/maglev/form/inputs/richtext.rb', line 7 def richtext(method, = {}) attributes = field_attributes(method) @template.render(Maglev::Uikit::Form::RichtextComponent.new( label: [:label].presence || attributes[:content], name: attributes[:name], options: (method, ), html_options: () )) end |
#richtext_component_html_options(options) ⇒ Object
28 29 30 |
# File 'app/lib/maglev/form/inputs/richtext.rb', line 28 def () [:html_options] || {} end |
#richtext_component_options(method, options) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/lib/maglev/form/inputs/richtext.rb', line 18 def (method, ) { value: .key?(:value) ? [:value] : object.public_send(method), placeholder: [:placeholder], line_break: [:line_break], edit_link_path: [:edit_link_path], error: (method) } end |