4
我使用Rails 3.1。如何訪問app/assets/*文件中的控制器變量
在我app/controllers/locations_controller.rb
我聲明變量@location
@location = Location.find(params[:id])
我有一個文件/app/assets/javascripts/locations.coffee.erb
,我想用@location
變量
myLatlng: new google.maps.LatLng(<%[email protected] %>, <%[email protected] %>)
它不工作開箱即用,是有沒有解決方案來實現這一目標?
我面臨同樣的問題...一些僞代碼將非常讚賞 – rwb