A Rhodes mobile app that fetches FX rates from Frankfurter (base EUR), displays them with flags, and includes an in-app converter.
- Ruby + Rhodes toolchain installed (rake, rho).
- Network access to https://api.frankfurter.app.
rake run:rhosimulator
This starts the simulator and serves the app.
- Rates list: Shows EUR-based rates with local-time "Rates updated" header and emoji flags per currency. Tap 🔄 Обновить or the toolbar Refresh to refetch; the callback returns to the list when done.
- Converter: Open via toolbar Convert or the screen button. Swap currencies and tap Calculate to get a live conversion (AJAX posts to
/app/CurrencyRate/calculate).
CurrencyRateController#load_ratescalls Frankfurter and rendersloading.erb.rates_callbacksaves rates (CurrencyRatetable) and redirects to index.should_update_rates?skips the fetch if data is < 1 hour old.
Flags come from public/js/flag.js (exposed as window.currencyFlags) and are applied on page load in app/CurrencyRate/index.erb via data-currency attributes.
- Force refresh: button 🔄 Refresh or toolbar Refresh (navigates to
/app/CurrencyRate/load_rates). - Open converter: button 📱 Converter or toolbar Convert (navigates to
/app/CurrencyRate/converter).
- If rates never return: check
rhosimulator/rholog.txtfor network errors/status inrates_callback. - If flags are blank: ensure
flag.jsis loaded (seeapp/layout.erb) andwindow.currencyFlagsis populated. - If Time.parse fails: confirm
require 'time'at the top ofcurrency_rate_controller.rb.
- Controllers:
app/CurrencyRate/currency_rate_controller.rb - Views:
app/CurrencyRate/index.erb,converter.erb,loading.erb - JS helpers:
public/js/flag.js,public/js/converter.js(legacy; AJAX now inline inconverter.erb) - Toolbar setup:
app/application.rb