ruby - Rails currency exchange gem that works? -


just wondering if has used currency exchange ruby gem gets exchange rates external api , works. have tried following gems have not been able of them function described:

goog_currency, yahoo_currency, google_currency, yahoo_finance_currency

one of these uses deprecated code , hence not work correctly.

i trying display currency exchange rate in rails view has been grabbed external api.

i have considered trying parse json yahoo/google finance urls seems harder should.

i picked google_currency list popular , has been maintained. worked fine me, ran code synopsis without problem.

if saw message:

you using old or stdlib version of json gem please upgrade recent version adding gemfile:    gem 'json', '~> 1.7.7' 

then may need update copy of multi_json avoid json deprecation warnings:

gem install json gem install multi_json 

which should (at time of writing) install json 1.8.0 , multi_json 1.7.8. or of course, if project, should able pick these versions in gemfile, provided there no conflict other libraries in project. message may of caused concern, not problem google_currency.

i didn't notice conflict or problems google_currency gem, using either deprecated json modules or recent ones. similar want:

require 'money' require 'money/bank/google_currency'  bank = money::bank::googlecurrency.new bank.get_rate(:gbp, :usd).to_f  => 1.5513 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -