Module: Maglev::Form::Inputs::Textarea
- Included in:
- FormBuilder
- Defined in:
- app/lib/maglev/form/inputs/textarea.rb
Instance Method Summary collapse
Instance Method Details
#textarea(method, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/lib/maglev/form/inputs/textarea.rb', line 7 def textarea(method, = {}) attributes = field_attributes(method) @template.render(Maglev::Uikit::Form::TextareaComponent.new( label: [:label].presence || attributes[:content], name: attributes[:name], options: (method, ), html_options: [:html_options] || {} )) end |
#textarea_component_options(method, options) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/lib/maglev/form/inputs/textarea.rb', line 18 def (method, ) { value: object.public_send(method), rows: [:rows], max_length: [:max_length], placeholder: [:placeholder], error: (method) } end |