Module: SmartTag::Helper

Defined in:
lib/smart_tag/helper.rb

Instance Method Summary collapse

Instance Method Details

#smart_tag(name, method, options = {}) ⇒ Object

def tadding_tag(name, content = nil, options = {})

id = sanitize_to_id(name)
input_html = { :id => id }.merge(options.delete(:input_html) || {})
output = ActiveSupport::SafeBuffer.new
output << text_area_tag(name, content, input_html)

end



11
12
13
14
15
16
17
18
# File 'lib/smart_tag/helper.rb', line 11

def smart_tag(name, method, options = {})
  input_html = (options.delete(:input_html) || {})
  hash = input_html.stringify_keys
  instance_tag = ActionView::Base::FormBuilder.new(name, method, self, options.delete(:object))
  instance_tag.send(:add_default_name_and_id, hash)      
  output_buffer = ActiveSupport::SafeBuffer.new
  output_buffer << instance_tag.to_text_area_tag(input_html)
end