class ActionView::Helpers::FormBuilder

Public Instance Methods

subdivision_select(method, country_or_options = {}, options = {}, html_options = {}) click to toggle source
# File lib/subdivision_select/subdivision_select_helper.rb, line 4
def subdivision_select(method, country_or_options = {}, options = {}, html_options = {})
  # Shift args, if necessary
  if Hash === country_or_options
    html_options = options
    options = country_or_options
  else
    options[:country] = country_or_options
  end

  # I think this is taken care of in the merge below?
  #options.merge!({ object: @object })

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