Module: Baddr::TagHelper

Defined in:
app/helpers/baddr/tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#baddr_city_tag(name, options = {}) ⇒ Object



9
10
11
12
# File 'app/helpers/baddr/tag_helper.rb', line 9

def baddr_city_tag(name, options={})
  options[:class] = (options.with_indifferent_access[:class].presence || []) << 'baddr-cities'
  select_tag name, '', options
end

#baddr_state_tag(name, options = {}) ⇒ Object



3
4
5
6
7
8
# File 'app/helpers/baddr/tag_helper.rb', line 3

def baddr_state_tag(name, options={})
  @states = State.all
  select_options = options_from_collection_for_select @states, 'code', 'name'
  options[:class] = (options.with_indifferent_access[:class].presence || []) << 'baddr-states'
  select_tag name, select_options, options
end