27
rated 0 times
[
28]
[
1]
/ answers: 1 / hits: 25197
/ 13 Years ago, mon, may 9, 2011, 12:00:00
I am trying to use insert an Javascript variable in the <%= %> tags but it prints the variable name verbose. Here is my code
<script>
function getGraph(agency,device_id)
{
var i = document.createElement('img');
i.src = '<%= show_graph_hcfcd_url('device_id') %>';
$(graphDiv).appendChild(i);
}
</script>
Now the Problem is URL gets generated just fine except instead of value of device_id, 'device_id' appears in the rest url.
Any clues how to get over this?
More From » ruby-on-rails