aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2014-06-05 10:25:20 -0500
committerZachary Scott <e@zzak.io>2014-06-05 10:25:20 -0500
commit7ea384bab2c4638e9bc2e04fd7ac166f947ec1c8 (patch)
treeccb206d97c6af7ee73effab2acc67cb49098e47b /actionview/lib/action_view/helpers
parent4f58b90bab50ab9a3a5d613e4df8dd2b1710732c (diff)
parentfd6df516a050b88538a9f519408bbf73354fdceb (diff)
downloadrails-7ea384bab2c4638e9bc2e04fd7ac166f947ec1c8.tar.gz
rails-7ea384bab2c4638e9bc2e04fd7ac166f947ec1c8.tar.bz2
rails-7ea384bab2c4638e9bc2e04fd7ac166f947ec1c8.zip
Merge pull request #15523 from gregmolnar/doc_fix
document include_blank's usage with a string [ci skip]
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb
index f12d436f8e..88b8400644 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -82,7 +82,7 @@ module ActionView
# ==== Options
# * <tt>:multiple</tt> - If set to true the selection will allow multiple choices.
# * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
- # * <tt>:include_blank</tt> - If set to true, an empty option will be created.
+ # * <tt>:include_blank</tt> - If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty.
# * <tt>:prompt</tt> - Create a prompt option with blank value and the text asking user to select something.
# * <tt>:selected</tt> - Provide a default selected value. It should be of the exact type as the provided options.
# * Any other key creates standard HTML attributes for the tag.
@@ -116,6 +116,9 @@ module ActionView
# select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: true
# # => <select id="people" name="people"><option value=""></option><option value="1">David</option></select>
#
+ # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All"
+ # # => <select id="people" name="people"><option value="">All</option><option value="1">David</option></select>
+ #
# select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something"
# # => <select id="people" name="people"><option value="">Select something</option><option value="1">David</option></select>
#