Thanks Bill.
I’ve tried a plugin called state_select and it worked good as long as
I wanted states from one country only.
The plugin can’t display states from both US and Canada.
So, I’ve added the following method to the application.rb:
def state_dropdown
states = [“Alabama”, “Alaska”, “Alberta”, “Arizona”, “Arkansas”,
“British Columbia”, “California”, “Colorado”, “Connecticut”,
“Delaware”, “Florida”, “Georgia”, “Hawaii”, “Idaho”, “Illinois”,
“Indiana”, “Iowa”, “Kansas”, “Kentucky”, “Louisiana”, “Maine”,
“Manitoba”, “Maryland”, “Massachusetts”, “Michigan”, “Minnesota”,
“Mississippi”, “Missouri”, “Montana”, “Nebraska”, “Nevada”, “New
Brunswick”, “New Hampshire”, “New Jersey”, “New Mexico”, “New York”,
“Newfoundland”, “North Carolina”, “North Dakota”, “Northwest
Territories”, “Nova Scotia”, “Nunavut”, “Ohio”, “Oklahoma”, “Ontario”,
“Oregon”, “Pennsylvania”, “Prince Edward Island”, “Puerto Rico”,
“Quebec”, “Rhode Island”, “Saskatchewan”, “South Carolina”, “South
Dakota”, “Tennessee”, “Texas”, “Utah”, “Vermont”, “Virginia”,
“Washington”, “Washington D.C.”, “West Virginia”, “Wisconsin”,
“Wyoming”, “Yukon”]
states.each do | s |
s
end
end
And I wanted to ask:
- Is this the right place to add this method?
- Would the above work?
Thanks,
Elle