diff --git a/lib/nested_form/builder_mixin.rb b/lib/nested_form/builder_mixin.rb index 26a98877..02979a2c 100644 --- a/lib/nested_form/builder_mixin.rb +++ b/lib/nested_form/builder_mixin.rb @@ -31,7 +31,7 @@ def link_to_add(*args, &block) options[:class] = [options[:class], "add_nested_fields"].compact.join(" ") options["data-association"] = association - options["data-blueprint-id"] = fields_blueprint_id = fields_blueprint_id_for(association) + options["data-blueprint-id"] = fields_blueprint_id = fields_blueprint_id_for(options[:blueprint] || association) args << (options.delete(:href) || "javascript:void(0)") args << options @@ -83,7 +83,7 @@ def fields_for_with_nested_attributes(association_name, *args) end @fields ||= {} - @fields[fields_blueprint_id_for(association_name)] = { :block => block, :options => options } + @fields[fields_blueprint_id_for(options[:blueprint] || association_name)] = { :block => block, :options => options } super(association_name, *(args << block)) end