diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-06-22 11:41:51 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-06-22 11:41:51 +0200 |
commit | 20d6630c1bb70f09e1f6a135bd3f9d690ad28250 (patch) | |
tree | 2f21535cc16e78ba238ab907de705f00f9de4bcd /actionpack/lib/action_view/helpers/form_options_helper.rb | |
parent | d897acfbb11aaa2d7f3138e1f9772546ecb6f981 (diff) | |
download | rails-20d6630c1bb70f09e1f6a135bd3f9d690ad28250.tar.gz rails-20d6630c1bb70f09e1f6a135bd3f9d690ad28250.tar.bz2 rails-20d6630c1bb70f09e1f6a135bd3f9d690ad28250.zip |
Replaced country_options_for_select with old,
untranslated version and moved country-related helpers to a new
FormCountryHelper helper module so that they can easily be moved to a plugin.
Updated tests accordingly.
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index a6b9e65a77..8ce092b015 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -133,11 +133,6 @@ module ActionView InstanceTag.new(object, method, self, nil, options.delete(:object)).to_collection_select_tag(collection, value_method, text_method, options, html_options) end - # Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags. - def country_select(object, method, priority_countries = nil, options = {}, html_options = {}) - InstanceTag.new(object, method, self, nil, options.delete(:object)).to_country_select_tag(priority_countries, options, html_options) - end - # Return select and option tags for the given object and method, using # #time_zone_options_for_select to generate the list of option tags. # @@ -270,30 +265,6 @@ module ActionView options_for_select += '</optgroup>' end end - - # Returns a string of option tags for pretty much any country in the world. Supply a country name as +selected+ to - # have it marked as the selected option tag. You can also supply an array of countries as +priority_countries+, so - # that they will be listed above the rest of the (long) list. - # - # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. - def country_options_for_select(*args) - options = args.extract_options! - - locale = options[:locale] - locale ||= request.locale if respond_to?(:request) - - selected, priority_countries = *args - countries = :'countries.names'.t options[:locale] - country_options = "" - - if priority_countries - # TODO priority_countries need to be translated? - country_options += options_for_select(priority_countries, selected) - country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n" - end - - return country_options + options_for_select(countries, selected) - end # Returns a string of option tags for pretty much any time zone in the @@ -349,8 +320,7 @@ module ActionView end # All the countries included in the country_options output. - # deprecated. please use :'countries.names'.t directly - COUNTRIES = :'countries.names'.t 'en-US' unless const_defined?("COUNTRIES") + COUNTRIES = ActiveSupport::Deprecation::DeprecatedConstantProxy.new 'COUNTRIES', 'ActionView::Helpers::FormCountryHelper::COUNTRIES' end class InstanceTag #:nodoc: |