To use the :country input, please install a country_select plugin

前端 未结 6 1300
-上瘾入骨i
-上瘾入骨i 2021-01-18 03:19

I have a country attribute to my guidelines model. I don\'t want to use a plugin, I just want to have country as a string. Everything is working until I try to edit a guide

6条回答
  •  不思量自难忘°
    2021-01-18 04:09

    You're using ActiveAdmin, so you're also using Formtastic.

    In Formtastic, in the file formtastic/lib/formtastic/inputs/country_input.rb it clearly says:

    # Rails doesn't come with a `country_select` helper by default any more, so you'll need to do
    # one of the following:
    #
    # * install the [country_select](https://github.com/stefanpenner/country_select) gem
    # * install any other country_select plugin that behaves in a similar way
    # * roll your own `country_select` helper with the same args and options as the Rails one
    

    I would add gem 'country-select' to your Gemfile and do a bundle install as is the simplest and fastest solution.

提交回复
热议问题