Module: Lexxy::ActionTextTag

Defined in:
lib/lexxy/action_text_tag.rb

Instance Method Summary collapse

Instance Method Details

#initialize(object_name, method_name, template_object, options = {}, &block) ⇒ Object



3
4
5
6
7
# File 'lib/lexxy/action_text_tag.rb', line 3

def initialize(object_name, method_name, template_object, options = {}, &block)
  super

  @block = block
end

#lexxy_renderObject



9
10
11
12
13
14
15
16
# File 'lib/lexxy/action_text_tag.rb', line 9

def lexxy_render
  options = @options.stringify_keys

  add_default_name_and_id(options)
  options["input"] ||= @template_object.dom_id(object, [ options["id"], :trix_input ].compact.join("_")) if object
  html_tag = @template_object.lexxy_rich_textarea_tag(options.delete("name"), options.fetch("value") { value }, options.except("value"), &@block)
  error_wrapping(html_tag)
end