Rails AJAX图像交换

I'm trying to make an AJAX call in Rails to swap images on a page. The page has a big div that is initially blank, along with a table with several entries. One of the columns in this table contains the path for an image, and what I am trying to do is on user click, swap this image into the div.

I was hoping to have a controller variable hold the path to the current image, and on user click store the new value into the variable, and I guess in the view somehow retrieve this value in an image_tag, but I haven't gotten it to work.

I haven't found any guides on how to do this, any ideas? I'm using prototype because Rails seems to prefer it, which doesn't work well for me because I come from a jQuery background...

this is a working example http://jsfiddle.net/S44dC/

Remotipart is the easiest way to make exiting remote form enable for image upload

https://github.com/JangoSteve/remotipart