Created
August 27, 2012 02:14
-
-
Save neilsmind/3485047 to your computer and use it in GitHub Desktop.
Making carmen 1.x work with Formtastic (file under app/lib in my app)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CountryInput < Formtastic::Inputs::CountryInput | |
def to_html | |
raise "To use the :country input, please install a country_select plugin, like this one: https://github.com/jamesds/country-select" unless builder.respond_to?(:country_select) | |
input_wrapping do | |
label_html << | |
builder.country_select(method, priority_countries, input_options) | |
end | |
end | |
def priority_countries | |
options[:priority_countries] || {priority: ['US','CA']} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you gotten the subregions to work with active admin and carmen?