A
anja
Hi,
I am working on a little ruby on rails project. I want to call a ruby
method out of the java_script code. The method takes two parameters,
which I have as javascript variables. How can I pass this javascript
variables to the ruby method?
Here is the source code of the rhtml file:
function updateMap(countryCode, city) {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
<% if GeoCoding.hasGeo(countryCode, city) then -%>
map.panTo(<%= GeoCoding.geo(countryCode, city) %>);
<% end -%>
}
}
I get the error :
undefined local variable or method `countryCode' for
#<#<Class:0xb761c578>:0xb761c4c4>
I understand why I get this error. But I have no idea how I can fix it.
Thanks,
anja
I am working on a little ruby on rails project. I want to call a ruby
method out of the java_script code. The method takes two parameters,
which I have as javascript variables. How can I pass this javascript
variables to the ruby method?
Here is the source code of the rhtml file:
function updateMap(countryCode, city) {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
<% if GeoCoding.hasGeo(countryCode, city) then -%>
map.panTo(<%= GeoCoding.geo(countryCode, city) %>);
<% end -%>
}
}
I get the error :
undefined local variable or method `countryCode' for
#<#<Class:0xb761c578>:0xb761c4c4>
I understand why I get this error. But I have no idea how I can fix it.
Thanks,
anja