Sha256: c06fe8f24513681b6d8f9381c067b73f1280972ba3d0595868899edb265e5767

Contents?: true

Size: 498 Bytes

Versions: 13

Compression:

Stored size: 498 Bytes

Contents

module MotionPrime
  class SubmitFieldSection < BaseFieldSection
    element :button, type: :button do
      {title: options[:name].to_s.titleize}.merge(options[:button] || {})
    end
    element :error_message, type: :error_message, text: proc { |field| field.all_errors.join("\n") if field.observing_errors? }

    after_element_render :button, :bind_button

    def bind_button
      view(:button).on :touch do
        form.send(options[:action]) if options[:action]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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