Module: Voncount::FormHelperExt

Defined in:
lib/voncount/voncount_form_helpers.rb

Instance Method Summary collapse

Instance Method Details

#voncount_text_area(object_name, method, options = {}) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/voncount/voncount_form_helpers.rb', line 39

def voncount_text_area(object_name, method, options = {})
  options[:class] = "von-countable #{options[:class]}"
   :div, class: "von-count-holder" do
    ActionView::Helpers::Tags::TextArea.new(object_name, method, self, options).render +
    (:span, '0', class: "von-counter")
  end
end

#voncount_text_field(object_name, method, options = {}) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/voncount/voncount_form_helpers.rb', line 31

def voncount_text_field(object_name, method, options = {})
  options[:class] = "von-countable #{options[:class]}"
   :div, class: "von-count-holder" do
    ActionView::Helpers::Tags::TextField.new(object_name, method, self, options).render +
    (:span, '0', class: "von-counter")
  end
end