lib/carmen/rails/action_view/form_helper.rb
# Generate select and subregion option tags for the given object and method. A
# common use of this would be to allow users to select a state subregion within
# a given country.
#
# name         - The name attribute for the select element.
# parent_region_or_code - An instance of Carmen::Region or a 2-character
#                         country code.
# options      - Other options pertaining to option tag generation. See
#                `region_options_for_select`.
# html_options - Options to use when generating the select tag- class,
#                id, etc.
#
# Uses region_options_or_select to generate the list of option tags.
#
# Example:
#
#   subregion_select_tag('state_code', 'US', {priority: ['US', 'CA']}, class: 'region')
#
# Returns an `html_safe` string containing the HTML for a select element.
Generate select and subregion option tags for the given object and method. A
common use of this would be to allow users to select a state subregion within
a given country.

name         - The name attribute for the select element.
parent_region_or_code - An instance of Carmen::Region or a 2-character
country code.
options      - Other options pertaining to option tag generation.

Uses region_options_or_select to generate the list of option tags.





Returns an `html_safe` string containing the HTML for a select element.
Generate select and subregion option tags for the given object and method . A common use of this would be to allow users to select a state subregion within a given country . name - The name attribute for the select element . parent_region_or_code - An instance of Carmen :: Region or a 2 - character country code . options - Other options pertaining to option tag generation . Uses region_options_or_select to generate the list of option tags . Returns an ` html_safe ` string containing the HTML for a select element .
def subregion_select_tag(name, value, parent_region_or_code, options = {}, html_options = {})
        options.stringify_keys!
        parent_region = determine_parent(parent_region_or_code)
        opts = region_options_for_select(parent_region.subregions, value, options)
        html_options = {"name" => name,
                        "id" => sanitize_to_id(name)}.update(html_options.stringify_keys)
        content_tag(:select, opts, html_options)
      end
def subregion_select_tag ( name , value , parent_region_or_code , options = { } , html_options = { } ) options . stringify_keys! parent_region = determine_parent ( parent_region_or_code ) opts = region_options_for_select ( parent_region . subregions , value , options ) html_options = { "name" => name , "id" => sanitize_to_id ( name ) } . update ( html_options . stringify_keys ) content_tag ( :select , opts , html_options ) end
Generate select and subregion option tags for the given object and method.
Generate select and subregion option tags for the given object and method .
name
value
parent_region_or_code
options
html_options