Sha256: c73df0cf18a0aacbc924cc391cbc09c41bd4a91e85d7e88095073e44c18f7cde

Contents?: true

Size: 668 Bytes

Versions: 24

Compression:

Stored size: 668 Bytes

Contents

module Sufia
  class FormBuilder < SimpleForm::FormBuilder
    def input_label(attribute_name, options = {})
      options = options.dup
      options[:input_html] = options.except(:as, :boolean_style, :collection, :label_method, :value_method, *ATTRIBUTE_COMPONENTS)
      options = @defaults.deep_dup.deep_merge(options) if @defaults

      input      = find_input(attribute_name, options)
      wrapper    = find_wrapper(input.input_type, options)
      components = (wrapper.components.map(&:namespace) & ATTRIBUTE_COMPONENTS) + [:input]
      components.map { |component| SimpleForm::Wrappers::Leaf.new(component) }

      input.label.html_safe
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sufia-7.4.1 app/builders/sufia/form_builder.rb
sufia-7.4.0 app/builders/sufia/form_builder.rb
sufia-7.3.1 app/builders/sufia/form_builder.rb
sufia-7.3.0 app/builders/sufia/form_builder.rb
sufia-7.3.0.rc3 app/builders/sufia/form_builder.rb
sufia-7.3.0.rc2 app/builders/sufia/form_builder.rb
sufia-7.3.0.rc1 app/builders/sufia/form_builder.rb
sufia-7.2.0 app/builders/sufia/form_builder.rb
sufia-6.7.0 lib/sufia/form_builder.rb
sufia-7.1.0 app/builders/sufia/form_builder.rb
sufia-7.0.0 app/builders/sufia/form_builder.rb
sufia-7.0.0.rc2 app/builders/sufia/form_builder.rb
sufia-7.0.0.rc1 app/builders/sufia/form_builder.rb
sufia-7.0.0.beta4 app/builders/sufia/form_builder.rb
sufia-7.0.0.beta3 app/builders/sufia/form_builder.rb
sufia-7.0.0.beta2 app/builders/sufia/form_builder.rb
sufia-7.0.0.beta1 app/builders/sufia/form_builder.rb
sufia-6.6.1 lib/sufia/form_builder.rb
sufia-6.6.0 lib/sufia/form_builder.rb
sufia-6.5.0 lib/sufia/form_builder.rb