Class: Simphi::SimphiInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
lib/simphi/simphi_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/simphi/simphi_input.rb', line 13

def input(wrapper_options)
  @io = ActiveSupport::SafeBuffer.new

  @builder.fields_for "#{attribute_name}-simphi" do |b|
    @hash_builder = b

    @io.tap do |sb|
      get_fields_for(required_attributes, 1, true)
      get_fields_for(not_required_attributes, required_attributes.count + 1)
      add_button
    end

  end
end