Permalink
Browse files

Revert.

  • Loading branch information...
1 parent 57b9358 commit 232ba6b31845185494528b4b070a26de98f5cfe1 @jksilliman committed Jun 26, 2011
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/nested_form/builder.rb
View
@@ -19,14 +19,12 @@ def link_to_add(*args, &block)
args << (options.delete(:href) || "javascript:void(0)")
args << options
@fields ||= {}
- unless object.persisted?
- @template.after_nested_form(association) do
- model_object = object.class.reflect_on_association(association).klass.new
- output = %Q[<div id="#{association}_fields_blueprint" style="display: none">].html_safe
- output << fields_for(association, model_object, :child_index => "new_#{association}", &@fields[association])
- output.safe_concat('</div>')
- output
- end
+ @template.after_nested_form(association) do
+ model_object = object.class.reflect_on_association(association).klass.new
+ output = %Q[<div id="#{association}_fields_blueprint" style="display: none">].html_safe
+ output << fields_for(association, model_object, :child_index => "new_#{association}", &@fields[association])
+ output.safe_concat('</div>')
+ output
end
@template.link_to(*args, &block)
end

0 comments on commit 232ba6b

Please sign in to comment.