nested $.param()

nested $.param()


Hey All
I just made the switch recently to jQuery from prototype and I'm
loving every minute of it :)
I've been using it a lot with a Ruby on Rails backend, and one of the
things I need was a way to nest params like the way Rails handles
forms/objects, eg. with a Page object:
page[name]=Foo&page[author]=Bar
Unfortunately, $.param didnt translate objects this way, but adding
just a few simple lines made it work like a charm:
http://gist.github.com/66948
Now:
$.param({page: {name: 'Foo', author: 'Bar'})
Translates to above.
Thought this might be helpful for other people working with Rails/
jQuery and with a little clean up could be a nice addition to core.
Thanks!
--AQ