Created
July 17, 2012 15:48
-
-
Save stevencwarren/3130218 to your computer and use it in GitHub Desktop.
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
| def export_to_js(name, value, opts={}) | |
| s = <<RUBY | |
| <script type="text/javascript"> | |
| DATA['#{name}'] = #{value.to_json(opts).html_safe}; | |
| </script> | |
| RUBY | |
| s.html_safe | |
| end | |
| put this in the application helper. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment