Authenticity problem with jrails ajax

I’m using jrails and I found when I use the authenticity_token in
certain javascript calls, that the
url works differently in that the paramters in the :with clause get
dropped if they are in a json type syntax.
Below is an example of a remote_function() call from JS that used to
work fine without authenticity.
When I enabled authenticity it adds the authenticity token
automatically, but drops sending the
data in the :with part. I commented out this code as shown and
inserted an actual ajax call that does work fine, with authenticity,
but seems like not as much of the prefered approach. I’ve had similar
problems with field_observer() calls in some cases. I think if the
json syntax is not used when there is just one parameter, it does

function update_server(info)

<%#= remote_function(:url => {:action => ‘resize_field’},
:with =>
‘{col:info.col,width:info.width}’) # auth-OK
dataType:‘script’, type:‘post’, url:’/shgrid/resize_field’})

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs