Skip to content

Instantly share code, notes, and snippets.

@andrew
Created May 22, 2009 14:01
Show Gist options
  • Save andrew/116144 to your computer and use it in GitHub Desktop.
Save andrew/116144 to your computer and use it in GitHub Desktop.
def counties_options
returning '' do |options|
options << content_tag(:optgroup, :label => 'England') do
options_for_select ['Bedfordshire', 'Berkshire', 'Bristol', 'Buckinghamshire', 'Cambridgeshire', 'Cheshire', 'City of London', 'Cornwall',
'Cumbria', 'Derbyshire', 'Devon', 'Dorset', 'Durham', 'East Riding of Yorkshire', 'East Sussex', 'Essex', 'Gloucestershire',
'Greater London', 'Greater Manchester', 'Hampshire', 'Herefordshire', 'Hertfordshire', 'Isle of Wight', 'Kent', 'Lancashire',
'Leicestershire', 'Lincolnshire', 'Merseyside', 'Norfolk', 'North Yorkshire', 'Northamptonshire', 'Northumberland',
'Nottinghamshire', 'Oxfordshire', 'Rutland', 'Shropshire', 'Somerset', 'South Yorkshire', 'Staffordshire', 'Suffolk', 'Surrey',
'Tyne and Wear', 'Warwickshire', 'West Midlands', 'West Sussex', 'West Yorkshire', 'Wiltshire', 'Worcestershire']
end
options << content_tag(:optgroup, :label => 'Scotland') do
options_for_select ['Aberdeenshire', 'Angus', 'Argyllshire', 'Ayrshire', 'Banffshire', 'Berwickshire', 'Buteshire', 'Cromartyshire',
'Caithness', 'Clackmannanshire', 'Dumfriesshire', 'Dunbartonshire', 'East Lothian', 'Fife', 'Inverness-shire',
'Kincardineshire', 'Kinross', 'Kirkcudbrightshire', 'Lanarkshire', 'Midlothian', 'Morayshire', 'Nairnshire', 'Orkney',
'Peeblesshire', 'Perthshire', 'Renfrewshire', 'Ross-shire', 'Roxburghshire', 'Selkirkshire', 'Shetland', 'Stirlingshire',
'Sutherland', 'West Lothian', 'Wigtownshire']
end
options << content_tag(:optgroup, :label => 'Wales') do
options_for_select ['Anglesey', 'Brecknockshire', 'Caernarfonshire', 'Carmarthenshire', 'Cardiganshire', 'Denbighshire', 'Flintshire',
'Glamorgan', 'Merioneth', 'Monmouthshire', 'Montgomeryshire', 'Pembrokeshire', 'Radnorshire']
end
options << content_tag(:optgroup, :label => 'Northern Ireland') do
options_for_select ['Antrim', 'Armagh', 'Down', 'Fermanagh', 'Londonderry', 'Tyrone']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment