If you find your self using the page<< command a lot extend the page object.
module ActionView
module Helpers
module PrototypeHelper
class JavaScriptGenerator
module GeneratorMethods
def becker
assign 'window.location.href', "http://stephenbeckeriv.com"
end
end
end
end
end
end
Save this in a ruby file in the lib directory and then require "file_name" in environment.rb after the boot line.
Now you can call this from your rjs template.
page.becker
I do not have any good code examples. I am not a big javascript person which is why I am happy I can extend it in ruby.