CurrencyConvertOnRails is a rails plugin to convert currencies into another currency. 61 currencies are available now. Thils plugin has an easy-to-use interface that uses Ajax. If you have something wrong with the plugin, Contact me at (firstname.lastname@example.org).
Make sure prototype.js(for rails < 3) or jquery.js(for rails >= 3) is included to view tamplates. If you need to use this plugin with jquery and rails < 3, send a message to email@example.com . I'll give you a solution.
Here you can see 4 steps to install the plugin, not so big deal.
- Check out firstname.lastname@example.org:yuki24/Currency-Convert-on-Rails.git
- Get your API key to register to http://www.exchangerate-api.com/
Do the following command.
rake currency_convert:setup api_key="YOUR-API-KEY"
For example, if your API key is "igi7By4dvx4cst":
rake currency_convert:setup api_key="igi7By4dvx4cst"
Do something like this: If you want to embed the currency convert form in "MoneyController#List", Add one phrase on the top of the controller.
MoneyController < ApplicationController enable_currency_convert "JPY" # replace JPY with another currency as default.
And then add the following code in the view "list.html.erb".
<%= currency_select_view( :amount => 100, :loading => '', :default => 'How mach in other currencies?') %>
also, you can write the form this way.
<%= currency_select_view( :amount => 'amount_field', :loading => '', :default => 'How mach in other currencies?') %>
now ready to convert!
Copyright (c) 2010 Yuki Nishijima, released under the MIT license.