Anyway, can I get an environment variable (e.g. API key) to appear inside JS / Coffee using Rails 3.1?
You can rename file.js to .js.erb and use ruby ββto access ENV:
<% do_something_with ENV['key'] %> some_js_code
Source: https://habr.com/ru/post/1243984/More articles:Potentially incorrect and annoying message: "This project uses SQL Server Express LocalDB" - asp.netWhat does bootstrap function do in Angular 2 - javascriptWhat happens when encode is used on str in python? - pythonHow SSO (Single Sign On) works - authenticationThe dynamic programming algorithm is similar to the Knapsack Java code - javaCyclical Reduction - javaDifferent rendering of Google fonts if @ font-face link or standard stylesheet is added? - cssParse a string into a Golang map - dictionaryHow to create Kubernetes namespace restricted users - namespacesCannot Find Microsoft Forms 2.0 Object Library or FM20.DLL - vbaAll Articles