C
cz
Hi:
Is it possible to assign a ruby string value to a javascript variable?
I can display the ruby value on the browser. It looks fine, but when I
try to pass the value to a javascript variable, an error ocurrs
(unterminated string literal). The code snippet below is my attempt.
var str = '<%= #{@str} %>';
I also tried the Ajax approach and that didn't work either. I am knew
to Ruby, Sinatra, and Haml. That being said, I am surprised at how
difficult this stuff is. Java and pHP were much easier. Any help or
hints would be greatly appreciated. Thanks in advance.
cz
Is it possible to assign a ruby string value to a javascript variable?
I can display the ruby value on the browser. It looks fine, but when I
try to pass the value to a javascript variable, an error ocurrs
(unterminated string literal). The code snippet below is my attempt.
var str = '<%= #{@str} %>';
I also tried the Ajax approach and that didn't work either. I am knew
to Ruby, Sinatra, and Haml. That being said, I am surprised at how
difficult this stuff is. Java and pHP were much easier. Any help or
hints would be greatly appreciated. Thanks in advance.
cz