app/helpers/application_helper.rb
def new_child_fields_template(form_builder, association, content_type=:div, options = {})
    options[:object] ||= form_builder.object.class.reflect_on_association(association).klass.new
    options[:partial] ||= form_builder.object.class.to_s.underscore.pluralize + "/"+ association.to_s.singularize
    options[:form_builder_local] ||= :f
    #content_for :jstemplates do
    content_tag(content_type, :id => "#{association}_fields_template", :class => "hide") do
      form_builder.fields_for(association, options[:object], :child_index => "new_#{association}") do |f|
        render(:partial => options[:partial], :locals => {options[:form_builder_local] => f, :aux_builder => form_builder})
      end
    end
  end
#folder param: in case the partial is not in the form_builder.object folder
folder param: in case the partial is not in the form_builder.object folder
folder param : in case the partial is not in the form_builder . object folder
def new_child_fields_template(form_builder, association, content_type=:div, options = {})
    options[:object] ||= form_builder.object.class.reflect_on_association(association).klass.new
    options[:partial] ||= form_builder.object.class.to_s.underscore.pluralize + "/"+ association.to_s.singularize
    options[:form_builder_local] ||= :f
    content_tag(content_type, :id => "#{association}_fields_template", :class => "hide") do
      form_builder.fields_for(association, options[:object], :child_index => "new_#{association}") do |f|
        render(:partial => options[:partial], :locals => {options[:form_builder_local] => f, :aux_builder => form_builder})
      end
    end
  end
def new_child_fields_template ( form_builder , association , content_type = :div , options = { } ) options [ :object ] ||= form_builder . object . class . reflect_on_association ( association ) . klass . new options [ :partial ] ||= form_builder . object . class . to_s . underscore . pluralize + "/" + association . to_s . singularize options [ :form_builder_local ] ||= :f content_tag ( content_type , :id => "#{association}_fields_template" , :class => "hide" ) do form_builder . fields_for ( association , options [ :object ] , :child_index => "new_#{association}" ) do | f | render ( :partial => options [ :partial ] , :locals => { options [ :form_builder_local ] => f , :aux_builder => form_builder } ) end end end
folder param: in case the partial is not in the form_builder.object folder
folder param : in case the partial is not in the form_builder . object folder
#content_for :jstemplates do
form_builder
association
content_type
options