rails ajax currency
How to create the following:
I want make ajax currency switcher with rails
[usd|rub|eur]
In db I have only usd value
What 开发者_如何学Pythongem suitable for this purpose? Or maybe browser-side solution is better?
Who has experience please give me advise
we use the Money Gem you can specify a Money column in your model to make the handling easier.
# Get exchange rates
Money.default_bank = ExchangeBankWhichScrapesXeDotCom.new
# new money object in USD
usd = Money.new(1000, "USD")
# exchange to rubel
rub = usd.exchange_to("RUB")
精彩评论