From 8e02dcdf4eb53aa741c73bf9cfa757ba401d2a27 Mon Sep 17 00:00:00 2001 From: Leandro Nunes Date: Fri, 20 Feb 2015 12:01:46 -0200 Subject: Corrects the API to method select_tag The 'selected' option is not doing what it should do. The expected behavior is to pass the value selected by default for the options_from_collection_for_select method --- actionview/lib/action_view/helpers/form_tag_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 8bb243b8b7..65a0548ffb 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -84,14 +84,13 @@ module ActionView # * :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. 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. # # ==== 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", options_from_collection_for_select(@people, "id", "name", "1") # # # # select_tag "people", "".html_safe -- cgit v1.2.3