I would like to use some erb in my .coffee
files, like the following example
myLatlng: new google.maps.LatLng(<%=@location.latitude %>, &l
I agree with Ciro Centelli to leave the asset pipeline alone, especially if you are using Heroku. No doubt gon
is useful if you need to many assignments, but you can also do this without a gem. In your html include
<%= javascript_tag do %>
window.latitude = <%=@location.latitude %>
window.longitdue = <%= @location.longitude %>
<% end %>
and in your coffee file
myLatlng: new google.maps.LatLng(window.latitude, window.longitude)
You can often work around other needs in a similar fashion. For instance if you do not want the coffee script to trigger on an element with particular id, then in the html use erb to only add that id when you want it triggered.