From fd6df516a050b88538a9f519408bbf73354fdceb Mon Sep 17 00:00:00 2001 From: Greg Molnar Date: Thu, 5 Jun 2014 13:53:39 +0100 Subject: document include_blank's usage with a string [ci skip] --- actionview/lib/action_view/helpers/form_tag_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (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 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 # * :multiple - If set to true the selection will allow multiple choices. # * :disabled - If set to true, the user will not be able to use this input. - # * :include_blank - If set to true, an empty option will be created. + # * :include_blank - 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. # * :prompt - Create a prompt option with blank value and the text asking user to select something. # * :selected - 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_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" + # # => + # # select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something" # # => # -- cgit v1.2.3