Plugins - Comma Parser

StarAdd to favorites

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.

Doug Ramsay

http://github.com/dramsay/comma_parser/tree/master

git://github.com/dramsay/comma_parser.git

Rails' (MIT)

  • Currently 3.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?