Module: ActionView::Helpers::FormOptionsHelper
- Defined in:
- lib/norwegian_county_select.rb
Constant Summary collapse
- NORWEGIAN_COUNTIES =
All the counties included in the norwegian_county_options output.
["Akershus", "Aust-Agder", "Buskerud", "Finnmark", "Hedmark", "Hordalan", "Møre og Romsdal", "Nord-Trøndelag", "Nordland", "Oppland", "Oslo", "Rogaland", "Sogn og Fjordane", "Sør-Trøndelag", "Telemark", "Troms", "Vest-Agder", "Vestfold", "Østfold"]
Instance Method Summary collapse
-
#norwegian_county_options_for_select(selected = nil) ⇒ Object
NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
-
#norwegian_county_select(object, method, options = {}, html_options = {}) ⇒ Object
Return select and option tags for the given object and method, using norwegian_county_options_for_select to generate the list of option tags.
Instance Method Details
#norwegian_county_options_for_select(selected = nil) ⇒ Object
NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
10 11 12 13 |
# File 'lib/norwegian_county_select.rb', line 10 def (selected = nil) = "" return + (NORWEGIAN_COUNTIES, selected) end |
#norwegian_county_select(object, method, options = {}, html_options = {}) ⇒ Object
Return select and option tags for the given object and method, using norwegian_county_options_for_select to generate the list of option tags.
6 7 8 |
# File 'lib/norwegian_county_select.rb', line 6 def norwegian_county_select(object, method, = {}, = {}) InstanceTag.new(object, method, self, .delete(:object)).to_norwegian_county_select_tag(, ) end |