If you don't want to use window. solution, here's a different idea to try.
This is what I do in my show.html.erb to pass a reverse geocoded address to map the point in a js function that uses google map API.
<!-- Must be set to pass instance vars to javascript -->
<%= javascript_tag "var js_marker_lat = #{@location.latitude.to_json};" %>
<%= javascript_tag "var js_marker_lng = #{@location.longitude.to_json};" %>
In the javascript function, you use the vars as usual.
var latlng = new google.maps.LatLng(js_marker_lat, js_marker_lng);
In the controller, javascript_tag helper is not available, so you may be limited to to using the html.erb files for js vars stuff.
Please let me know how it goes.