Open padde opened 9 months ago
PS: For anyone else having this problem - as a temporary workaround, we have added the following custom input which uses the new method signature:
module Formtastic
module Inputs
class CustomCountryInput
include Base
CountrySelectPluginMissing = Class.new(StandardError)
def to_html
raise CountrySelectPluginMissing, 'To use the :country input, please install a country_select plugin, like this one: https://github.com/stefanpenner/country_select' unless builder.respond_to?(:country_select)
input_wrapping do
label_html <<
builder.country_select(method, input_options.reverse_merge(priority_countries:), input_html_options)
end
end
def priority_countries
options[:priority_countries] || builder.priority_countries
end
end
end
end
then used it as
f.input :country, as: :custom_country, ...
@padde Thank you for documenting this issue and the workaround!
Just ran into this myself.
When using with country_select >= 9.0.0 we get the following error:
This is due to the method signature of
country_select
form builder having changed via https://github.com/countries/country_select/commit/021845dafffb65bb51bb6ebc0e40c540a9e83b1aI could work on a fix for this however I would like to discuss first, should both the old and the new version be supported, or should an error be raised for versions <= 9.0.0, effectively forcing an upgrade?