Sha256: e2f0a3832d8614c1927507114b44354a89f8e791e01f01787781f11644cdbeac

Contents?: true

Size: 1.26 KB

Versions: 23

Compression:

Stored size: 1.26 KB

Contents

module FlexaFormtasticBootstrap
  module Helpers
    module InputsHelper
      include FlexaFormtasticBootstrap::Helpers::FieldsetWrapper

        def inputs(*args, &block)
          wrap_it = @already_in_an_inputs_block ? true : false
          @already_in_an_inputs_block = true
        
          title = field_set_title_from_args(*args)
          html_options = args.extract_options!
          html_options[:class] ||= "inputs"
          html_options[:name] = title

          out = begin
            if html_options[:for] # Nested form
              inputs_for_nested_attributes(*(args << html_options), &block)
            elsif block_given?
              field_set_and_list_wrapping(*(args << html_options), &block)
            else
              legend = args.shift if args.first.is_a?(::String)
              args = default_columns_for_object if @object && args.empty?
              contents = fieldset_contents_from_column_list(args)
              args.unshift(legend) if legend.present?
              field_set_and_list_wrapping(*((args << html_options) << contents))
            end
          end
        
          # out = template.content_tag(:li, out, :class => "input") if wrap_it
          @already_in_an_inputs_block = false
          out
        end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
flexa_lib-0.5.2 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.5.1 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.5.0 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.9 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.8 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.7 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.6 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.5 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.4 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.3 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.2 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.1 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.3.0 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.9 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.8 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.7 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.6 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.5 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.4 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb
flexa_lib-0.2.3 lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb