-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access Rails settings (development.yml , test.yml etc.) #1895
Comments
You can put something like this (and more) in your <script>
window.mySettingsVariable = <%== @my_settings_variable.to_json %>;
</script> A more complecated, but just as valid way of doing this would be to use the Note: Anyone who visits your site can access variables set on the |
Ya thats right. I'm afraid binding to a window object might have security consequences. |
JavaScript is completely client-side, anything you expose to is will be available to your users (even if not assigned to |
Can this issue be closed ? |
How to access rails settings variable (from development.yml etc.) inside JavaScript?
The text was updated successfully, but these errors were encountered: