upmin / upmin-admin-ruby

Framework for creating powerful admin backends with minimal effort in Ruby on Rails.
MIT License
755 stars 66 forks source link

Add a "money in cents" attribute partial #158

Closed tfe closed 9 years ago

tfe commented 9 years ago

Add an attribute partial for showing attributes that are an amount of money in units of cents, or more specifically:

  1. Strips "cents" from the label
  2. Divides the amount by 100 to get whole dollars
  3. Shows the currency symbol

Note that this (similar to the progress bar partial) does not allow editing of the amount. It would be possible to implement this, but it you'd have to parse the user input back into cents, which seems like it could go wrong in more ways than I want to deal with right now.

(Partially) fixes #155.

tfe commented 9 years ago

Did you see the notes from @mbrookes in https://github.com/upmin/upmin-admin-ruby/issues/155? Not objecting to the merge; just wanted to make sure you saw his thoughts on it.

jdurand commented 9 years ago

Yes, but I felt that your _money_cents partial was a nice default.

tfe commented 9 years ago

:+1: