Module: Baddr::TagHelper
- Defined in:
- app/helpers/baddr/tag_helper.rb
Instance Method Summary collapse
- #baddr_city_tag(name, value, options = {}) ⇒ Object
- #baddr_state_tag(name, value, options = {}) ⇒ Object
Instance Method Details
#baddr_city_tag(name, value, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/baddr/tag_helper.rb', line 10 def baddr_city_tag(name, value, ={}) [:class] = (.with_indifferent_access[:class].presence || []) << 'baddr-cities' = if @state_value.present? (City.for_state(@state_value), 'id', 'name', value) else '' end select_tag name, , end |
#baddr_state_tag(name, value, options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/baddr/tag_helper.rb', line 3 def baddr_state_tag(name, value, ={}) @states = State.all @state_value = value = @states, 'code', 'name', value [:class] = (.with_indifferent_access[:class].presence || []) << 'baddr-states' select_tag name, , end |