<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'Multi-model forms' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/43/topics/337</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>Multi-model forms posted by Kurt Wiedenhoeft @ Wed, 11 Jun 2008 20:24:43 -0000</title>
      <description>&lt;p&gt;I am also enjoying this book. I have had good luck with this recipe, but I&amp;#8217;m running into a problem when I try to add a date or date/time select box to the &amp;#8220;tasks&amp;#8221; section. I have the code working great, but as soon as I add this to my partial, it breaks:&lt;/p&gt;


	&lt;p&gt;&amp;lt;%= task_form.date_select :pickup_at %&amp;gt;&lt;/p&gt;


	&lt;p&gt;When I add a new task and submit the form, I get a 500 error, and the following message in the log:&lt;/p&gt;


	&lt;p&gt;&amp;#8220;Conflicting types for parameter containers. Expected an instance of Array but found an instance of Hash. This can be caused by colliding Array and Hash parameters like qs[]=value&amp;#38;qs[key]=value.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;If I manually add the related record to the table, it will render the date select properly and I can submit changes without error. However, any new tasks I add will cause the submit to fail. This looks very much like the problem mentioned here:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://dev.rubyonrails.org/ticket/10551"&gt;http://dev.rubyonrails.org/ticket/10551&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I applied the patch supplied, but it didn&amp;#8217;t make a difference. Has anyone else run into this, and maybe found a solution?&lt;/p&gt;


	&lt;p&gt;Thanks,&lt;/p&gt;


	&lt;p&gt;Kurt&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 20:24:43 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:43:337:3134</guid>
      <author>Kurt Wiedenhoeft</author>
      <link>http://forums.pragprog.com/forums/43/topics/337</link>
    </item>
    <item>
      <title>Multi-model forms posted by Alexander Ungur @ Wed, 26 Mar 2008 09:37:04 -0000</title>
      <description>&lt;p&gt;First of all, thank you for a great book. I found it very useful.&lt;/p&gt;


	&lt;p&gt;On the multi-models forms recipe, there&amp;#8217;s one little gotcha: all goes well and smooth until you get to the save part. There, things may go smooth if all your data in child rows is valid. Or you can even get nice validation errors if you use validates_associated. However if the save of child rows fails for whatever reasons (say, because of using callbacks, that properly return false hoping to break the save chain) you run out of luck. No child rows being saved and no errors whatsoever so that you can have a clue what&amp;#8217;s going on. In other words, to quote from AWDwR:&lt;/p&gt;


	&lt;p&gt;&amp;#8220;Finally, there&amp;#8217;s a danger here. If the child row cannot be saved (for example, because it fails validation), Active Record will not complain &amp;#8211; you&amp;#8217;ll get no indication that the row was not added to the database.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;Perhaps it would be a good idea to remind the users of this recipe of that danger, might spare them of a few headaches :-)&lt;/p&gt;


	&lt;p&gt;Have a great day&lt;/p&gt;</description>
      <pubDate>Wed, 26 Mar 2008 09:37:04 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:43:337:2491</guid>
      <author>Alexander Ungur</author>
      <link>http://forums.pragprog.com/forums/43/topics/337</link>
    </item>
  </channel>
</rss>
