Class: ActionView::Helpers::InstanceTag

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

Instance Method Summary collapse

Instance Method Details

#to_region_select_tag(parent_region, options = {}, html_options = {}) ⇒ Object


189
190
191
192
193
194
195
196
# File 'lib/carmen/rails/action_view/form_helper.rb', line 189

def to_region_select_tag(parent_region, options = {}, html_options = {})
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  priority_regions = options[:priority] || []
  value = options[:selected] ? options[:selected] : value(object)
  opts = add_options(region_options_for_select(parent_region.subregions, value, :priority => priority_regions), options, value)
  ("select", opts, html_options)
end