Senthil Nayagam wrote:> Hi Mohit,
>
>
> hidden_field(object_name, method, options = {})
>
> expects a object name and generates a ouput of form object[method] which
> is what you are getting but in html escaped format %5B === [ and %5D ===
> ]
>
> if you want simple form fields you can code manually
>
> <input name="q" value="80" type="hidden"
/>
> <input name="v" value="100" type="hidden"
/>
>
> but if insist on a rails way
> <%= hidden_field "q", nil, {:value => "80"}
%>
> <%= hidden_field "v", nil, {:value => "100"}
%>
>
Thanks Senthil,
I would have liked to stay the Rails way and that was why I was asking
(I am aware of the direct HTML manual way). I used what you suggested
as the Rails way.
It works fine on the controller side - I can use the variable params[:q]
and params[:v] to construct my query! Thanks.
However, the GET request still goes with blank box brackets so it is
called as:
/controller/query?start%5B%5D=2006-07-12&stop%5B%5D=2006-08-12
It works fine, but it looks a bit ugly, so I guess I''ll have to stick
with the manual way for now...
Cheers
Mohit.