To give a bigger picture. The user inputs a postcode. If I can find this postcode in my coordinates database, I use these coordinates. If I can't, I need to call a JS (Google AJAX Search API method) to geocode the postcode, and use the returned coordinates.
I have tried to create a RJS template which calls the geocoding function. I tried doing this by redirect_to :action => 'method'. This showed the RJS file in plain text!
I'm quite lost in this. Any help is greatly appreciated.