Accessing a Javascript variable in embedded Ruby

Hi, I have a form that I am observing with observe_field

<%= observe_field :guess,
:frequency => 0.6,
:update => ‘ajaxWrapper’,
:url => {:action => ‘feedback’, :only_path => false},
:with => ‘correct=#{@chapter[0])}’

When I construct the parameters for the URL, I’d like to use a
javascript variable to index into the chapter array. (Instead of
always selecting the first element as in the example above)

Is that possible? I can’t figure out how to access the variable from
within the #{}