From 6d71384afb7a91429637c0267056ac7a9ccb7983 Mon Sep 17 00:00:00 2001 From: ZENATI YASSINE Date: Sat, 19 Apr 2014 18:18:03 +0200 Subject: [ci skip] Added example for number_field_tag method --- .../lib/action_view/helpers/form_tag_helper.rb | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'actionview/lib/action_view/helpers/form_tag_helper.rb') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 3104d424dc..8f10eb46ad 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -735,12 +735,40 @@ module ActionView # * :max - The maximum acceptable value. # * :in - A range specifying the :min and # :max values. + # * :within - Same as :in. # * :step - The acceptable value granularity. # * Otherwise accepts the same options as text_field_tag. # # ==== Examples + # number_field_tag 'quantity' + # # => + # + # number_field_tag 'quantity', '1' + # # => + # + # number_field_tag 'quantity', nil, class: 'special_input' + # # => + # + # number_field_tag 'quantity', nil, min: 1 + # # => + # + # number_field_tag 'quantity', nil, max: 9 + # # => + # # number_field_tag 'quantity', nil, in: 1...10 # # => + # + # number_field_tag 'quantity', nil, within: 1...10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10, step: 2 + # # => + # + # number_field_tag 'quantity', '1', class: 'special_input', disabled: true + # # => def number_field_tag(name, value = nil, options = {}) options = options.stringify_keys options["type"] ||= "number" -- cgit v1.2.3