Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created December 14, 2010 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmad3/740439 to your computer and use it in GitHub Desktop.
Save workmad3/740439 to your computer and use it in GitHub Desktop.
include ActionView::Helpers::FormOptionsHelper
include ActionView::Helpers::TagHelper
counties = [["England", ["Bedfordshire", "Berkshire", "Bristol", "Buckinghamshire", "Cambridgeshire", "Cheshire", "Cornwall", "Cumbria", "Derbyshire", "Devon", "Dorset", "Durham", "East Yorkshire", "East Sussex", "Essex", "Gloucestershire", "Greater Manchester", "Hampshire", "Herefordshire", "Isle of Wight", "Kent", "Lancashire", "Leicestershire", "Lincolnshire", "London", "Merseyside", "Norfolk", "North Yorkshire", "Northamptonshire", "Northumberland", "Nottinghamshire", "Oxfordshire", "Rutland", "Shropshire", "Somerset", "South Yorkshire", "Staffordshire", "Suffolk", "Surrey", "Tyne & Wear", "Warwickshire", "West Midlands", "West Sussex", "West Yorkshire", "Wiltshire", "Worcester"]], ["Northern Ireland", ["County Antrim", "County Armagh", "County Down", "County Fermanagh", "County Londonderry", "County Tyrone"]], ["Scotland", ["Aberdeenshire", "Angus", "Argyll & Bute", "Clackmannanshire", "Dumfries & Galloway", "Dundee", "East Ayrshire", "East Dunbarton", "East Lothian", "East Renfrewshire", "Edinburgh", "Falkirk", "Fife", "Glasgow", "Highland", "Midlothian", "Moray", "North Ayrshire", "North Lanarkshire", "Orkney", "Perth & Kinross", "Renfrewshire", "Scottish Borders", "Shetland Islands", "South Ayrshire", "South Lanarkshire", "Stirling", "West Dunbarton", "West Lothian", "Western Isles"]], ["Wales", ["Anglesey", "Blaenau Gwent", "Bridgend", "Caerphilly", "Cardiff", "Carmarthenshire", "Ceredigion", "Conwy", "Denbighshire", "Flintshire", "Gwynedd", "Merthyr Tydfil", "Monmouthshire", "Neath Port Talbot", "Newport", "Pembrokeshire", "Powys", "Rhondda Cynon Taff", "Swansea", "Torfaen", "Vale of Glamorgan", "Wrexham"]]]
puts grouped_options_for_select(counties)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment