Sha256: 03a11c873104192313d334bdf747a46824ecbffdfac9df054e2ae5f08b093fd1

Contents?: true

Size: 525 Bytes

Versions: 10

Compression:

Stored size: 525 Bytes

Contents

module MotionPrime
  class StringFieldSection < BaseFieldSection
    element :label, type: :label do
      default_label_options
    end

    element :input, type: :text_field, delegate: proc { collection_delegate } do
      options[:input] || {}
    end

    element :error_message, type: :error_message, text: proc { |field| field.all_errors.join("\n") if field.observing_errors? }
    after_element_render :input, :bind_text_input

    def value
      view(:input).text
    end

    def input?
      true
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
motion-prime-1.0.7 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.6 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.5 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.4 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.3 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.2 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.1 motion-prime/sections/form/string_field_section.rb
motion-prime-1.0.0 motion-prime/sections/form/string_field_section.rb
motion-prime-0.9.9.2 motion-prime/sections/form/string_field_section.rb
motion-prime-0.9.9.1 motion-prime/sections/form/string_field_section.rb