Sha256: e38be5bcd7d332eaa6e97cfb7c56f7ee60a317a5036efb4f1779f19cf2371dbd

Contents?: true

Size: 698 Bytes

Versions: 25

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true
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

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/builders/hyrax/form_builder.rb
hyrax-5.0.0 app/builders/hyrax/form_builder.rb
hyrax-5.0.0.rc3 app/builders/hyrax/form_builder.rb
hyrax-5.0.0.rc2 app/builders/hyrax/form_builder.rb
hyrax-5.0.0.rc1 app/builders/hyrax/form_builder.rb
hyrax-3.6.0 app/builders/hyrax/form_builder.rb
hyrax-4.0.0 app/builders/hyrax/form_builder.rb
hyrax-4.0.0.rc3 app/builders/hyrax/form_builder.rb
hyrax-4.0.0.rc2 app/builders/hyrax/form_builder.rb
hyrax-4.0.0.rc1 app/builders/hyrax/form_builder.rb
hyrax-3.5.0 app/builders/hyrax/form_builder.rb
hyrax-4.0.0.beta2 app/builders/hyrax/form_builder.rb
hyrax-3.4.2 app/builders/hyrax/form_builder.rb
hyrax-4.0.0.beta1 app/builders/hyrax/form_builder.rb
hyrax-3.4.1 app/builders/hyrax/form_builder.rb
hyrax-3.4.0 app/builders/hyrax/form_builder.rb
hyrax-3.3.0 app/builders/hyrax/form_builder.rb
hyrax-3.2.0 app/builders/hyrax/form_builder.rb
hyrax-3.1.0 app/builders/hyrax/form_builder.rb
hyrax-3.0.2 app/builders/hyrax/form_builder.rb