Skip to content

Instantly share code, notes, and snippets.

@birchestx
Created October 30, 2014 03:43
Show Gist options
  • Save birchestx/d078c50e706380bcd5c4 to your computer and use it in GitHub Desktop.
Save birchestx/d078c50e706380bcd5c4 to your computer and use it in GitHub Desktop.
Change currency symbol on view Rails/JS
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