From 663a9f344c6c066c5e0df3ae74a0cf14ced8af5e Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 21 Oct 2012 13:12:29 -0400 Subject: [PATCH] some fixes --- lib/cocoon/formtastic/cocoon_input.rb | 4 ++-- lib/cocoon/view_helpers.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cocoon/formtastic/cocoon_input.rb b/lib/cocoon/formtastic/cocoon_input.rb index 209f157..ab28893 100644 --- a/lib/cocoon/formtastic/cocoon_input.rb +++ b/lib/cocoon/formtastic/cocoon_input.rb @@ -15,10 +15,10 @@ class CocoonInput end output << template.content_tag(:div, :class => 'links') do - template.link_to_add_association template.t('.add'), builder, method + template.link_to_add_association template.t('.add'), builder, method, input_html_options end - template.content_tag(:li, output.join('').html_safe, :class => 'input cocoon') + template.content_tag(:li, output.join('').html_safe, wrapper_html_options) end end diff --git a/lib/cocoon/view_helpers.rb b/lib/cocoon/view_helpers.rb index f83a207..c059263 100644 --- a/lib/cocoon/view_helpers.rb +++ b/lib/cocoon/view_helpers.rb @@ -35,6 +35,7 @@ module Cocoon partial = get_partial_path(custom_partial, association) locals = render_options.delete(:locals) || {} method_name = f.respond_to?(:semantic_fields_for) ? :semantic_fields_for : (f.respond_to?(:simple_fields_for) ? :simple_fields_for : :fields_for) + f.send(method_name, association, new_object, {:child_index => "new_#{association}"}.merge(render_options)) do |builder| partial_options = {:f => builder, :dynamic => true}.merge(locals) render(partial, partial_options)