Class: ActionView::Helpers::FormBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/carmen/rails/action_view/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#country_select(method, priorities_or_options = {}, options_or_html_options = {}, html_options = {}) ⇒ Object

Generate select and country option tags with the provided name. A common use of this would be to allow users to select a country name inside a web form.

See `FormOptionsHelper::country_select` for more information.


231
232
233
234
235
236
237
238
239
240
241
# File 'lib/carmen/rails/action_view/form_helper.rb', line 231

def country_select(method, priorities_or_options = {}, options_or_html_options = {}, html_options = {})
  if priorities_or_options.is_a? Array
    options = options_or_html_options
    options[:priority] = priorities_or_options
  else
    options = priorities_or_options
    html_options = options_or_html_options
  end

  @template.country_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
end

#subregion_select(method, parent_region_or_code, options = {}, html_options = {}) ⇒ Object

Generate select and subregion option tags with the provided name. A common use of this would be to allow users to select a state subregion within a given country.

See `FormOptionsHelper::subregion_select` for more information.


248
249
250
# File 'lib/carmen/rails/action_view/form_helper.rb', line 248

def subregion_select(method, parent_region_or_code, options = {}, html_options = {})
  @template.subregion_select(@object_name, method, parent_region_or_code, objectify_options(options), @default_options.merge(html_options))
end