def nested_form_for_main_fields(klass, nested_klass, options={})
      form_for_main_fields(klass,options) do |form_field|
        nested_table_name = nested_klass.to_s.underscore.pluralize.to_sym
        main_model_name = klass.to_s.underscore.to_sym
        form_field.has_many nested_table_name, allow_destroy: true do |form|
          nested_klass.main_fields.map { |f| ExtensionedSymbol.new(f).cut_id }.each do |nested_field|
            current_options = options.fetch(nested_table_name){{}}.fetch(nested_field){{}}
            form.input(nested_field, current_options) unless nested_field == main_model_name
          end
        end
      end
    end
def nested_form_for_main_fields(klass, nested_klass, options={})
      form_for_main_fields(klass,options) do |form_field|
        nested_table_name = nested_klass.to_s.underscore.pluralize.to_sym
        main_model_name = klass.to_s.underscore.to_sym
        form_field.has_many nested_table_name, allow_destroy: true do |form|
          nested_klass.main_fields.map { |f| ExtensionedSymbol.new(f).cut_id }.each do |nested_field|
            current_options = options.fetch(nested_table_name){{}}.fetch(nested_field){{}}
            form.input(nested_field, current_options) unless nested_field == main_model_name
          end
        end
      end
    end
simple nested set for 2 classes with defined main_fields