Sha256: 6c61a6230467851a30bb9aa6e635f64dddc16c642134be0a8914fb258219c372

Contents?: true

Size: 668 Bytes

Versions: 58

Compression:

Stored size: 668 Bytes

Contents

module Hyrax
  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

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/builders/hyrax/form_builder.rb
hyrax-2.9.5 app/builders/hyrax/form_builder.rb
hyrax-2.9.4 app/builders/hyrax/form_builder.rb
hyrax-2.9.3 app/builders/hyrax/form_builder.rb
hyrax-2.9.2 app/builders/hyrax/form_builder.rb
hyrax-2.9.1 app/builders/hyrax/form_builder.rb
hyrax-2.9.0 app/builders/hyrax/form_builder.rb
hyrax-2.8.0 app/builders/hyrax/form_builder.rb
hyrax-2.7.2 app/builders/hyrax/form_builder.rb
hyrax-2.7.1 app/builders/hyrax/form_builder.rb
hyrax-2.7.0 app/builders/hyrax/form_builder.rb
hyrax-2.6.0 app/builders/hyrax/form_builder.rb
hyrax-3.0.0.pre.rc1 app/builders/hyrax/form_builder.rb
hyrax-3.0.0.pre.beta3 app/builders/hyrax/form_builder.rb
hyrax-2.5.1 app/builders/hyrax/form_builder.rb
hyrax-2.5.0 app/builders/hyrax/form_builder.rb
hyrax-3.0.0.pre.beta2 app/builders/hyrax/form_builder.rb
hyrax-2.4.1 app/builders/hyrax/form_builder.rb
hyrax-3.0.0.pre.beta1 app/builders/hyrax/form_builder.rb
hyrax-2.4.0 app/builders/hyrax/form_builder.rb