Ruby on Rails is known for its issue with money conversion. Things work pretty well for developers until they face up with eCommerce projects and money conversion. Money Rails is a library designed to help you with this issue. Find details inside.

Money Rails is a handy tool that helps to make all the conversions as accurate as possible. By the way one of the contributors of this tool is Yury Koleda, co-founder of Rubyroids Labs. But this is not the only reason we feature this product 🙂 First and foremost Money Rails is an efficient and handy library for eCommerce solutions. Let us show you how to use it.

Installing Money Rails

Installation process is pretty straightforward:

  1. Add gem ‘money-rails’ to your Gemfile
  2. Then launch ‘bundle’

Basically, this is it. ‘But why should I use Money Rails?’ – you might ask. We have answer for this question as well.

What Money Rails is about?

If to cut a long story short Money Rails is used to provide integration with Money gem for Rails. After its installation you will be able to use the following classes:

  1. Money class – stores amounts of money
  2. Money: :currency – stores currency type

Besides, you will have an API to convert amount of money from one currency to another. Money is given in Integer values (instead of Float, which is highly not recommended).

Basically, all these things would let you easily convert sum of money to any currency you set.

Now with Money Rails you can enjoy flexibility and freely use Money objects for your projects.

In Rubyroid Labs we use this tool ourselves, when working on bank integration and some eCommerce projects.

How useful was this post?

Click on a star to rate it!

Average rating 4.9 / 5. Vote count: 17

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Author

Daria Stolyar is a Marketing Manager at Rubyroid Labs. You can follow her at Linkedin.

Write A Comment