aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2011-05-16 23:43:05 +0900
committerAkira Matsuda <ronnie@dio.jp>2011-05-16 23:45:39 +0900
commit4d1752bfb225e6e973375e10f52063060b49e666 (patch)
treec78f0bfbc9eb10cf6ebeaf7bec54e556655e7e25 /railties/lib/rails
parent12a4376ae96f79ec0ba889a70a4390531d1d6ffd (diff)
downloadrails-4d1752bfb225e6e973375e10f52063060b49e666.tar.gz
rails-4d1752bfb225e6e973375e10f52063060b49e666.tar.bz2
rails-4d1752bfb225e6e973375e10f52063060b49e666.zip
generate HTML5 number_field tag for integer fields
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/generated_attribute.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb
index b26161f1d0..9450894b05 100644
--- a/railties/lib/rails/generators/generated_attribute.rb
+++ b/railties/lib/rails/generators/generated_attribute.rb
@@ -13,12 +13,13 @@ module Rails
def field_type
@field_type ||= case type
- when :integer, :float, :decimal then :text_field
- when :time then :time_select
- when :datetime, :timestamp then :datetime_select
- when :date then :date_select
- when :text then :text_area
- when :boolean then :check_box
+ when :integer then :number_field
+ when :float, :decimal then :text_field
+ when :time then :time_select
+ when :datetime, :timestamp then :datetime_select
+ when :date then :date_select
+ when :text then :text_area
+ when :boolean then :check_box
else
:text_field
end