I had this same problem, I just needed the US States in a select.
Here's the code I used which resolved it (for me)
module ApplicationHelper
def us_states
Carmen::Country.coded('US').subregions.map { |c| c.code }
end
end
...and then in my view:
<%= f.input_field :state, collection: us_states, include_blank: false %>
Example using PARAMS to provide Country Code
module ApplicationHelper
def get_subregions(country_code = 'US')
Carmen::Country.coded(country_code).subregions.map { |c| c.code }
end
end
Then, generate a route to your view, capturing a param, like www.mysite.com/myform/US
get 'myform/:cc', to: 'mycontroller#edit'
and finally, in your view use this as input to your helper. Like thus:
<%= f.input_field :state, collection: get_subregions(params[:cc]), include_blank: false %>
Note: this is purely pseudocode, so you may have to tweak it to get it to work properly.