If you want to pass ruby object to javascript function then do the followin steps…
In Ruby Controller Action…
def sample
ruby_variable = “Something”
ruby_variable.to_json
end
In Ruby RJS File
page.call ‘java_script_function_name’, ruby_variable
In JavaScript
function java_script_function_name(java_script_variable){
alert(java_script_variable);
}
java_script_variable comes in the form of array of javascript.
Add comments if anyone wants

