Skip to content

Commit

Permalink
document include_blank's usage with a string [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmolnar committed Jun 5, 2014
1 parent bb8b214 commit fd6df51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actionview/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -82,7 +82,7 @@ def form_tag(url_for_options = {}, options = {}, &block)
# ==== 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.
Expand Down Expand Up @@ -116,6 +116,9 @@ def form_tag(url_for_options = {}, options = {}, &block)
# 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>
#
Expand Down

0 comments on commit fd6df51

Please sign in to comment.