Rails, AJAX, and extra URL parameters

I recently updated an app from 1.1.6 to 1.2.3

Some places in the code, there are items like this:

                <%= in_place_editor "overrule_#{@candidate.id}_#{@

question.id}",
{:url =>{
:controller =>‘grade’,
:action=>‘set_grade_overrule’,
:candidate_id => @candidate.id,
:question_id=> @question.id},
}
%>

instead of rendering ?candidate_id=1&question_id=1552
we get ?candidate_id=1&question_id=1552

Now, I can solve this problem by defining routes, but is this correct
that
the URL is getting escaped? That seems wrong to me.

Is there a better way to pass additional parameters to the server
instead of
in the url when doing an ajax call?

Brian H. wrote:

instead of rendering ?candidate_id=1&question_id=1552
we get ?candidate_id=1&question_id=1552

I believe that is how it is supposed to work. Valid XHTML syntac says
that attributes of elements must be HTML escaped.

When the browser makes the request, it should properly decode it to what
its supposed to be.

I know you can pass jaascript variables with the request, but I am not
familar with the sytac of that. Look up the :with option on the ajax
helpers.

Yeah… it “should” decode it… but according to firebug, and my Rails
application, it does not.

Firebug’s output:

amp;question_id1729candidate_id1
Notice that it’s amp;question_id instead of question_id. So it’s the
unescaping that’s broken?

I don’t like the ‘with’ option cos I always screw it up, but it would
probably be better. Right now this is fixable with named routes… but
man,
why can’t it be easy?