Module: ActionView::Helpers::FormOptionsHelper
- Defined in:
- lib/countries/select_helper.rb
Instance Method Summary collapse
- #country_options_for_select(selected = nil, priority_countries = nil) ⇒ Object
- #country_select(object, method, priority_countries = nil, options = {}, html_options = {}) ⇒ Object
Instance Method Details
#country_options_for_select(selected = nil, priority_countries = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/countries/select_helper.rb', line 10 def (selected = nil, priority_countries = nil) = "" if priority_countries priority_countries = [*priority_countries].map {|x| [x,Country::NameIndex[x]] } += (priority_countries, selected) += "<option value=\"\" disabled=\"disabled\">-------------</option>\n" end return + (Country::Names, selected) end |
#country_select(object, method, priority_countries = nil, options = {}, html_options = {}) ⇒ Object
6 7 8 |
# File 'lib/countries/select_helper.rb', line 6 def country_select(object, method, priority_countries = nil, = {}, = {}) InstanceTag.new(object, method, self, .delete(:object)).to_country_select_tag(priority_countries, , ) end |