Skip to content
💰 A plugin to deal with money in Administrate, with the help of Money gem
Ruby HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
lib/administrate/field
spec
vendor/assets/javascripts
.gitignore
.rspec
.ruby-version
.travis.yml
CHANGELOG.md
Gemfile
LICENSE.md
README.md
Rakefile
administrate-field-money.gemspec
demo.gif

README.md

Administrate::Field::Money

Build Status Code Climate

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.1.2'

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.

You can’t perform that action at this time.