Created
October 30, 2014 03:43
-
-
Save birchestx/d078c50e706380bcd5c4 to your computer and use it in GitHub Desktop.
Change currency symbol on view Rails/JS
This file contains 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
In Controller Setup: | |
@currency_symbol = Money::Currency.new(<model currency code>).symbol | |
In layout html: | |
<div id="currency_symbol" style="display:none"><%= @currency_symbol %></div> | |
In JS: | |
var currency_symbol = $('#currency_symbol').text(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment