Class: TextareaTag

Inherits:
LiquidumBlock
  • Object
show all
Defined in:
lib/scribo/liquid/tags/textarea_tag.rb

Overview

Add a text-area, either specifying everything manually or using a model object on the form

Basic usage:

{%textarea name:"name"%}{%endtextarea%}

Advanced usage:

{%textarea name%}{%endtextarea%}

This last usage requires a model on the form

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/scribo/liquid/tags/textarea_tag.rb', line 14

def render(context)
  super

  result = %[<textarea] +
           attr_str(:name, arg(:name), input(:name, argv1)) +
           attr_str(:id, arg(:id), input(:id, argv1))

  result += attrs_str(reject: %[name id])
  result += %[>] + render_body + %[</textarea>]

  result
end