Sha256: 39ae923e4cf390a735f2f23852c924829bb50d6063131fef0d01b1af0a2db06f

Contents?: true

Size: 1.27 KB

Versions: 9

Compression:

Stored size: 1.27 KB

Contents

module ActionView
  module Helpers
    module FormOptionsHelper

      DEFAULT_TEXTAREA_WIDTH = 550
      DEFAULT_TEXTAREA_HEIGHT = 200

      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

      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
    end

    class FormBuilder
      def boolean_yes_no_select(method, options = {}, html_options = {})
        @template.boolean_yes_no_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
      end

      def textile_text_area(method, options = {}, html_options = {})
        @template.textile_text_area(@object_name, method, objectify_options(options))
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
etabliocms_core-0.0.12 lib/form_helper.rb
etabliocms_core-0.0.11 lib/form_helper.rb
etabliocms_core-0.0.10 lib/form_helper.rb
etabliocms_core-0.0.9 lib/form_helper.rb
etabliocms_core-0.0.8 lib/form_helper.rb
etabliocms_core-0.0.7 lib/form_helper.rb
etabliocms_core-0.0.6 lib/form_helper.rb
etabliocms_core-0.0.5 lib/form_helper.rb
etabliocms_core-0.0.4 lib/form_helper.rb