Class: ButtonTag

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

Overview

Adds a (by default submit) button

Basic usage:

{%button name:'commit' value:'save'%}Save{%endbutton%}

Advanced usage:

{%button button name:'commit' value:'save'%}Save{%endbutton%}
{%button reset name:'commit' value:'save'%}Save{%endbutton%}

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/scribo/liquid/tags/button_tag.rb', line 13

def render(context)
  super

  %[<button] + attr_str(:type, argv1, 'submit') +
    attr_str(:name, arg(:name), 'commit') +
    attr_str(:value, arg(:value)) +
    attr_str(:class, arg(:class)) +
    %[>] + render_body + %[</button>]
end