Module: ActionView::Helpers::FormOptionsHelper

Defined in:
lib/form_helper.rb

Constant Summary collapse

DEFAULT_TEXTAREA_WIDTH =
550
DEFAULT_TEXTAREA_HEIGHT =
200

Instance Method Summary collapse

Instance Method Details

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



8
9
10
11
12
13
14
# File 'lib/form_helper.rb', line 8

def boolean_yes_no_select(object_name, method, options = {}, html_options = {})
  choices = [
    ['Ano', true],
    ['Ne', false],
  ]
  InstanceTag.new(object_name, method, self, options.delete(:object)).to_select_tag(choices, options, html_options)
end

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



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/form_helper.rb', line 16

def textile_text_area(object_name, method, options = {})
  html = InstanceTag.new(object_name, method, self, options.delete(:object)).to_text_area_tag(options)
  id = options[:id] || "#{object_name}_#{method}"
  html << javascript_tag do
    %Q(
            $(function() {
                $('##{id}').markItUp(mySettings);
            });
        )
  end
  html
end