lib/samson/form_builder.rb
# Creates multi-row input field
Creates multi-row input field
Creates multi - row input field
def fields_for_many(association, add_rows_allowed: false)
      content = ''.html_safe
      content << fields_for(association) do |a|
        content_tag(:div, class: 'form-group') do
          yield(a)
          @template.concat @template.delete_checkbox a
        end
      end
      content << @template.link_to("Add row", "#", class: "duplicate_previous_row") if add_rows_allowed
      content
    end
def fields_for_many ( association , add_rows_allowed : false ) content = '' . html_safe content << fields_for ( association ) do | a | content_tag ( :div , class : 'form-group' ) do yield ( a ) @template . concat @template . delete_checkbox a end end content << @template . link_to ( "Add row" , "#" , class : "duplicate_previous_row" ) if add_rows_allowed content end
Creates multi-row input field
Creates multi - row input field
association
add_rows_allowed