zooppa / administrate-field-money

💰 A plugin to deal with money in Administrate, with the help of Money gem

Home Page:https://github.com/thoughtbot/administrate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Administrate::Field::Money

No Maintenance Intended Build status Code Climate


IMPORTANT NOTICE

This gem is not actively maintained anymore.

If you’re interested in taking over and steward the project moving forward, please get in touch.


A plugin to deal with money in Administrate, with the help of Money gem.

IMPORTANT: this plugin expects the attribute to be an integer representing the number of cents, with a name ending in _cents.

Usage

Add it to your Gemfile:

gem 'administrate-field-money', '~> 0.3.0'

Run:

$ bundle install

Add to your FooDashboard:

ATTRIBUTE_TYPES = {
  amount_cents: Field::Money.with_options(
    code: 'USD', # EUR, CAD, GBP, AUD, JPY, ...
    symbol: '$',
    delimiter: ',',
    separator: '.'
  ),
}.freeze

The field will figure out the appropriate thousand separator and decimal delimiter for the unit.

Demo

About

Administrate::Field::Money is maintained by Zooppa.

See also the list of contributors who participated in this project.

About

💰 A plugin to deal with money in Administrate, with the help of Money gem

https://github.com/thoughtbot/administrate

License:MIT License


Languages

Language:Ruby 72.8%Language:HTML 14.8%Language:JavaScript 12.4%