This adds a very basic country select that wraps the country_select with the correct markup.
I'm sure there is something that could make it better, but for my use (default, no options) it works just fine.
Also it is nicer then getting an exception since the builder has nothing when you have a field called country.
I'd like to see this merged!
Trying your master with carmen and
<%= f.input :home, :as => :country %>
gives me Formtastic::UnknownInputError. What's the API for this?
@jibiel @nicholashubbard Could you update your patch and confirm if you think it's ready to merge?
class CountryInput < Formtastic::Inputs::CountryInput
builder.country_select(method, priority_countries, input_options, input_html_options)
I added this to config/initializers/formtastic.rb and it works like a charm.
@rhomeister is that any different than the patch? GitHub is now saying that it will merge cleanly, which means I'm ready to merge this if there are no other issues with it.
Only difference I see is @rhomeister uses bootstrap_wrapping where as my patch uses generic_input_wrapping.
I'm not sure which is the better one to use in this case.
I tried generic_input_wrapping, but got the following exception:
undefined method `generic_input_wrapping' for #<FormtasticBootstrap::Inputs::CountryInput:0x000000076bca40>
I have updated the code in the pull request to use bootstrap_wrapping instead of generic_input_wrapping. This should be good to go now.
Thanks! Could you squash your commits together? (git rebase -i)
Adding a very basic contry input type
As requested they have been squashed into a single commit