Class: Plum::LiquidTags::FormTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/plum/liquid_tags/form_tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, markup, options) ⇒ FormTag

Returns a new instance of FormTag.



4
5
6
7
# File 'lib/plum/liquid_tags/form_tag.rb', line 4

def initialize(tag_name, markup, options)
  super
  @handle_expression = Liquid::Expression.parse(markup.strip)
end

Instance Method Details

#render(context) ⇒ Object



9
10
11
12
13
14
# File 'lib/plum/liquid_tags/form_tag.rb', line 9

def render(context)
  handle = context.evaluate(@handle_expression).to_s
  renderer = context.registers[:form_renderer]

  renderer ? renderer.call(handle) : ""
end