From 55880b342180011cf4c95154aba8fdfcc71b9418 Mon Sep 17 00:00:00 2001 From: Rizwan Reza Date: Wed, 30 Apr 2014 21:59:32 -0700 Subject: Add documentation to select_tag for :selected option --- actionview/lib/action_view/helpers/form_tag_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 8f10eb46ad..1f931a300d 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -83,13 +83,17 @@ module ActionView # * :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. - # * :prompt - Create a prompt option with blank value and the text asking user to select something + # * :prompt - Create a prompt option with blank value and the text asking user to select something. + # * :selected - Provide a default selected value. The value provided should be the exact type the options are provided. # * Any other key creates standard HTML attributes for the tag. # # ==== Examples # select_tag "people", options_from_collection_for_select(@people, "id", "name") # # # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), selected: ["1", "David"] + # # + # # select_tag "people", "".html_safe # # => # -- cgit v1.2.3