public
Description: Rails plugin to allow commas for numeric fields in ActiveRecord models
Homepage:
Clone URL: git://github.com/dramsay/comma_parser.git
Doug Ramsay (author)
Mon Oct 06 13:44:14 -0700 2008
commit  7cce17ffe8a790cd537843af234d6603a855be0b
tree    cfbc3112410cc9806af4d2d4b89ae9a7152e3a5b
parent  892b1a7428d113a8b261f69e1181c0c1fbbc5226
name age message
file .gitignore Loading commit data...
file MIT-LICENSE
file README
file Rakefile
file init.rb
directory lib/
directory test/
README
CommaParser
===========

This plugin allows you to accept commas from users for integer fields in 
an ActiveRecord model.


Example
=======

# Table name: cities
#
#  id           :integer(11)     not null, primary key
#  name         :string(50)
#  population   :integer(11)

class City < ActiveRecord::Base
  allow_commas :population


  # rest of class
end

Now the user can type population "1,000,000" into a form and it will still 
save correctly as "1000000" instead of "1". This saves you the hassle of stripping 
out commas either in JavaScript or in the controller.

Copyright (c) 2008 Doug Ramsay and Intridea, Inc., released under the MIT license