Rails code in a Javascript function

Hi guys!

In Rails, can you stick Rails code in a javascript function? An example,
this code from the Geokit plugin on a view page which doesnt work for
me:

    function initialize() {
        var map = new GMap(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-122.443882, 37.769079), 5);

        <[email protected] do |place|%>
        var point = new

GPoint(<%=place[:longitude]%>,<%=place[:latitude]%>);
var marker = createMarker(point,’

<%=h
place[:description]%>
’)
map.addOverlay(marker);
<%end%>
}

Any help would be appreciated!

cheers!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs