Module: ActiveScaffold::Bridges::CountryHelper::CountryHelpers

Defined in:
lib/active_scaffold/bridges/country_helper/country_helper_bridge.rb

Instance Method Summary collapse

Instance Method Details

#country_select(object, method, priority_countries = nil, options = {}, html_options = {}) ⇒ Object

Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.



8
9
10
# File 'lib/active_scaffold/bridges/country_helper/country_helper_bridge.rb', line 8

def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
  country_select_class.new(object, method, self, options).to_country_select_tag(priority_countries, options, html_options)
end

#country_select_classObject



4
5
6
# File 'lib/active_scaffold/bridges/country_helper/country_helper_bridge.rb', line 4

def country_select_class
  defined?(ActionView::Helpers::InstanceTag) ? ActionView::Helpers::InstanceTag : ActionView::Helpers::Tags::CountrySelect
end

#usa_state_select(object, method, priority_states = nil, options = {}, html_options = {}) ⇒ Object



12
13
14
# File 'lib/active_scaffold/bridges/country_helper/country_helper_bridge.rb', line 12

def usa_state_select(object, method, priority_states = nil, options = {}, html_options = {})
  country_select_class.new(object, method, self, options).to_usa_state_select_tag(priority_states, options, html_options)
end