Created
April 23, 2018 16:38
-
-
Save petitJAM/f30af43c20fc681066d89c5c06faf8fc to your computer and use it in GitHub Desktop.
Ruby constants in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.ProjectName.SomeModel = {} | |
window.ProjectName.SomeModel.SomeConstants = {} | |
<% SomeModel::SomeConstants.constants.each do |constant| %> | |
window.ProjectName.SomeModel.SomeConstants.<%= constant %> = "<%= SomeModel::SomeConstants.const_get(constant) %>" | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment