erb in coffee script with rails 3.1

前端 未结 5 970
野性不改
野性不改 2020-12-04 15:51

I would like to use some erb in my .coffee files, like the following example

myLatlng: new google.maps.LatLng(<%=@location.latitude %>, &l         


        
5条回答
  •  孤城傲影
    2020-12-04 16:37

    If you want erb in the .coffee files IN YOUR VIEW folder, leave your file named as yourfilename.js.coffee, and Rails will still process the ERB, oddly enough.

    To make it work in Heroku, move coffee-rails out of the assets group in your Gemfile.

提交回复
热议问题