-
-
Save BigMcLargeHuge/15f72edb56a73a2b1ba88854ceb8bdf1 to your computer and use it in GitHub Desktop.
Blogpost: formatting numerical input with rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @model do |f| %> | |
<%= f.text_field :decimal, label: "Just a number with commas and 2 decimal places", data: {autonumeric: true} %> | |
<%= f.text_field :dollaz, label: "Standard monitary input", data: {autonumeric: {aSign: '$ ', mDec: 2}} %> | |
<%= f.text_field :integer, label: "Just an integer with commas", data: {autonumeric: {mDec: 0}} %> | |
<%= f.text_field :posInt, label: "Positive integer with commas", data: {autonumeric: {vMin: 0}} %> | |
<%= f.text_field :posDec, label: "Positive decimal with commas and two decimal places", data: {autonumeric: {vMin: 0.00}} %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment