# Bundling REST POSTs?

**URL:** <https://www.ruby-forum.com/t/bundling-rest-posts/107397>\
**Category:** Rails\
**Created:** [June 21, 2007, 9:05am UTC](https://www.ruby-forum.com/t/bundling-rest-posts/107397 "2007-06-21T09:05:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 21, 2007, 9:05am UTC](https://www.ruby-forum.com/t/bundling-rest-posts/107397/1 "2007-06-21T09:05:27Z")

</div>

I will be sending about 3000 REST POSTs every 15 seconds. What is the  
best way to bundle them? Would I have to create a custom action and/or  
controller unbundle them? Is there an easier way through a plugin or  
library?

thanks  
chirag

---

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 21, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/bundling-rest-posts/107397/2 "2007-06-21T17:23:52Z")

</div>

On 6/21/07, chirag [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I will be sending about 3000 REST POSTs every 15 seconds. What is the  
> best way to bundle them? Would I have to create a custom action and/or  
> controller unbundle them? Is there an easier way through a plugin or  
> library?

I just committed a patch that handles xml arrays. Try this in your  
console to see what the xml should look like:

> > posts = Post.find(:all)  
> > xml = posts.to\_xml(:root =\> ‘posts’)  
> > puts xml

It works both ways:

> > Hash.from\_xml(xml)

If you’re POSTing to an xml-formatted rails action, the parsing to the  
params hash should be all handled for you of course.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 22, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/bundling-rest-posts/107397/3 "2007-06-22T23:04:42Z")

</div>

On Jun 21, 10:22 am, “Rick O.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I just committed a patch that handles xml arrays. Try this in your  
> console to see what the xml should look like:

Rick, thanks! What do you mean “by committed a patch”? A patch to  
what?

> If you’re POSTing to an xml-formatted rails action, the parsing to the  
> params hash should be all handled for you of course.

What do you mean by “handled for you”? I created the controllers and  
actions using the scaffold\_resource generator. Are you saying that the  
existing POST action will recognize that the POSTs are bundled in an  
array and process each individual one all automatically?

---

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 24, 2007, 4:15pm UTC](https://www.ruby-forum.com/t/bundling-rest-posts/107397/4 "2007-06-24T16:15:08Z")

</div>

On 6/22/07, chirag [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> what?  
> to Rails.

> > If you’re POSTing to an xml-formatted rails action, the parsing to the  
> > params hash should be all handled for you of course.
> 
> What do you mean by “handled for you”? I created the controllers and  
> actions using the scaffold\_resource generator. Are you saying that the  
> existing POST action will recognize that the POSTs are bundled in an  
> array and process each individual one all automatically?

It’ll parse the xml into params for you.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
