Agile Web Development

Build it. Launch it. Love it.

Comma Parser

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

Example

  # Table name: cities
  # population   :integer(11)

  class City < ActiveRecord::Base
    allow_commas :population
  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.

Vitals

Home http://github.com/dramsay/comma_parser/tree/master
Repository git://github.com/dramsay/comma_parser.git
License Rails' (MIT)
Tags Tag_red
Rating (3 votes)
Owner Doug Ramsay
Created 6 October 2008

Comments

Add a comment