From b7d657dcfaa6e0efbd3f7a068c67e24fca09943c Mon Sep 17 00:00:00 2001 From: Arnaud Doyen Date: Wed, 20 Jun 2012 22:52:48 +0200 Subject: [PATCH] [#1007] target.new and target.build adds new empty element in collection. --- hobo_rapid/taglibs/html/a.dryml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hobo_rapid/taglibs/html/a.dryml b/hobo_rapid/taglibs/html/a.dryml index db2443392..8d290b294 100644 --- a/hobo_rapid/taglibs/html/a.dryml +++ b/hobo_rapid/taglibs/html/a.dryml @@ -114,7 +114,7 @@ The standard AJAX attributes are supported. nil_view elsif action == "new" # Link to a new object form - new_record = target.respond_to?(:build) ? target.build : target.new + new_record = (target.class==Array) ? target.member_class.new : target.new new_record.set_creator(current_user) href = object_url(target, "new", params._?.merge(:subsite => subsite))