The following S-Rscript job adds a new record to a Dynarex document:







Note: the Dynarex method could be implemented within a gem but for now it's simpler to manipulate the XML directly.

Tested:
http://rscript.rorbuilder.info/do/dynarex/edit/contacts/index.xml/create?name=Mark&age=42

Observed (from index.xml):




<br /> <description/> <br /> <recordx_type>dynarex</recordx_type> <br /> <format_mask>[!name] [!age] [!dob]</format_mask> <br /> <schema>contacts[title,description]/contact(name,age,dob)</schema> <br /> </summary> <br /> <records> <br /> <contact><name>Jessica</name><age>37</age><dob/></contact> <br /> <contact><name>Mark</name><age>42</age><dob/></contact> <br /> </records> <br /></contacts> <br /></pre><img src="http://feeds.feedburner.com/~r/dzone/snippets/~4/7Bcw1W7qD9w" height="1" width="1" /><p><strong>Read more:</strong> <a class="rssreadon" rel="external" title="S-Rscript: Creating a new Dynarex record" href="http://feeds.dzone.com/~r/dzone/snippets/~3/7Bcw1W7qD9w/11307" target="_blank">http://feeds.dzone.com/~r/dzone/snippets/~3/7Bcw1W7qD9w/11307</a></p> </div> </div> </div> </div> </div> </div> <div class="rt-grid-3"> <div id="rt-sidebar-a"> <div class="module-outline-1"> <div class="module-outline-2"> <div class="rt-block"> <div class="module-content"> <div class="in-module-content"> <script type="text/javascript"><!-- google_ad_client = "pub-1887577456589456"; /* 160x600, created 2/23/09 */ google_ad_slot = "1228644438"; google_ad_width = 160; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div> </div> </div> </div> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> <div id="rt-copyright"> <div class="rt-container"> <div class="rt-grid-12 rt-alpha rt-omega"> <div class="clear"></div> <div class="rt-block"> CodersResource.com </div> </div> <div class="clear"></div> </div> </div> <div id="totop"> <div class="rt-grid-12 rt-alpha rt-omega"> <div class="clear"></div> <div class="rt-block"> <a href="#pageTop" id="gototop" class="no-click no-print">Scroll To Top</a> </div> </div> </div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-7819541-1"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>