Hey Nicolas,
> > On Feb 6, 8:27 am, kangax <[EMAIL PROTECTED]> wrote:
> > > All you need is turn range object into an array by calling it's
> > > toArray method:
> > >
> > > new Ajax.Request('/browse/get_stuff', {
> > > parameters: { a: 10, b: 'helo', c: $R(0,40).toArray() },
> > > ...
> > > })
> >
> > With this the query becomes:
> >
> > http://localhost:3000/browse/get_houses?a=10&b=helo&c=0&c=1&c=2&c=3&c...
>
> Then { ...., b: "helo", "c[]": $R(0,40).toArray() } will generate
>
> ...&c[]=0&c[]=1...
>
> Which should end up generating an array in the params[:c] hash ([0, 1,
> 2, 3, 4...]).
That is interesting - I didn't think of that. Unfortunately, I didn't
want to expand the range (as they can become very large) but rather
have the javascript range object, which looks something like "{ start:
0, end: 40, exclusive: false }", translated into a ruby object on the
server side. If I pass the range object by itself, everything works
great. It's only when I embed it in another object that it fails
(until I switched to parsing JSON in my controller).
Thanks,
Mike.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---