Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2010 13:57
What would you like to do?
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