diff options
author | Marcel Molina <marcel@vernix.org> | 2006-04-25 19:38:52 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-04-25 19:38:52 +0000 |
commit | 5d61d2336cceebf388369f22fa4cfbc07983bde5 (patch) | |
tree | d83b6ac97d5299ada2d31099616dc15d9c0b59f5 /actionpack/lib/action_view/helpers/form_options_helper.rb | |
parent | 7a01561a6e2ac7e5ab0117d5099a7040a9324202 (diff) | |
download | rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.tar.gz rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.tar.bz2 rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.zip |
Refactor various InstanceTag instance method to class methods. Closes #4800. [skaes@web.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 53b39305fa..4c830afb02 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -299,6 +299,7 @@ module ActionView def to_select_tag(choices, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options) + value = value(object) selected_value = options.has_key?(:selected) ? options[:selected] : value content_tag("select", add_options(options_for_select(choices, selected_value), options, value), html_options) end @@ -306,6 +307,7 @@ module ActionView def to_collection_select_tag(collection, value_method, text_method, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options) + value = value(object) content_tag( "select", add_options(options_from_collection_for_select(collection, value_method, text_method, value), options, value), html_options ) @@ -314,12 +316,14 @@ module ActionView def to_country_select_tag(priority_countries, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options) + value = value(object) content_tag("select", add_options(country_options_for_select(value, priority_countries), options, value), html_options) end def to_time_zone_select_tag(priority_zones, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options) + value = value(object) content_tag("select", add_options( time_zone_options_for_select(value, priority_zones, options[:model] || TimeZone), |