From fb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8 Mon Sep 17 00:00:00 2001 From: ZENATI YASSINE Date: Sat, 19 Apr 2014 18:05:18 +0200 Subject: [ci skip] Added example for email_field_tag method --- actionview/lib/action_view/helpers/form_tag_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 66c9e20682..47d4c04b09 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -698,6 +698,19 @@ module ActionView # # ==== Options # * Accepts the same options as text_field_tag. + # + # ==== Examples + # email_field_tag 'name' + # # => + # + # email_field_tag 'email', 'email@example.com' + # # => + # + # email_field_tag 'email', nil, class: 'special_input' + # # => + # + # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true + # # => def email_field_tag(name, value = nil, options = {}) text_field_tag(name, value, options.stringify_keys.update("type" => "email")) end -- cgit v1.2.3 From 320d436141e197e1c254563f77feff00610d15cf Mon Sep 17 00:00:00 2001 From: ZENATI YASSINE Date: Sat, 19 Apr 2014 18:09:07 +0200 Subject: [ci skip] Added example for date_field_tag method --- actionview/lib/action_view/helpers/form_tag_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 47d4c04b09..3104d424dc 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -614,6 +614,19 @@ module ActionView # # ==== Options # * Accepts the same options as text_field_tag. + # + # ==== Examples + # date_field_tag 'name' + # # => + # + # date_field_tag 'date', '01/01/2014' + # # => + # + # date_field_tag 'date', nil, class: 'special_input' + # # => + # + # date_field_tag 'date', '01/01/2014', class: 'special_input', disabled: true + # # => def date_field_tag(name, value = nil, options = {}) text_field_tag(name, value, options.stringify_keys.update("type" => "date")) end -- cgit v1.2.3 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') 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