Robert Walker wrote in post #1084592:
Thank you, I am doing so.
But $('#my_div').data("x") is not working form me, I had to do this:
HTML:
<div id="my_div" data-x='<%= my_ruby_var %>'>
JS:
var div=document.getElementById('my_div');
var x = div.getAttribute("data-x");
Btw, I think I could remove all Javascript code by rhtml by using this.
But what about css? Could something like that be done with css?
I have inline css with the :style attribute where I put my ruby
variable:
(...)
:style => "width:" + my_ruby_var + "px"
(...)
If i want to do a separate css file, how can I access to this ruby
variable from inside the .css ?
Thank You