coffeescriptでrailsの環境変数を利用する
1040 ワード
env.js.coffee.erb
window.ENV = {}
window.ENV.RailsEnv = "<%= Rails.env %>"
application.js
//= require env
hoge.coffee
console.log window.ENV.RailsEnv
Author And Source
この問題について(coffeescriptでrailsの環境変数を利用する), 我々は、より多くの情報をここで見つけました https://qiita.com/noppefoxwolf/items/d243ce458eeb7ac79961著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .