Money
The Money
field is used to display a monetary value.
ruby
field :price, as: :money, currencies: %w[EUR USD RON PEN]
Money Field Example
You can explore the implementation of the money field in avodemo and it's corresponding code on GitHub here
Example on new
![Avo](/assets/img/money-field.png)
![Avo](/assets/img/money-field2.png)
Example on show with currencies USD
![Avo](/assets/img/money-field-show.png)
Example on show with currencies RON
![Avo](/assets/img/money-field-show-lei.png)
Example on index
![Avo](/assets/img/money-field-index.png)
Installation
This field is a standalone gem. You have to add it to your Gemfile
alongside the money-rails
gem.
Add this field to the Gemfile
ruby
# Gemfile
gem "avo-money_field"
gem "money-rails", "~> 1.12"