gpt4 book ai didi

ruby-on-rails - 要使用 :country input, 请安装 country_select 插件

转载 作者:行者123 更新时间:2023-12-04 03:40:55 24 4
gpt4 key购买 nike

我的指南模型有一个国家属性。我不想使用插件,我只想将国家作为字符串。一切正常,直到我尝试在 activeadmin 中编辑指南,然后收到错误消息:

ActionView::Template::Error (To use the :country input, please install a country_select plugin, like this one: https://github.com/jamesds/country-select): 1: insert_tag renderer_for(:edit)



在我的形式我有
 <%= f.input :country, as: :string%>

在我的 admin/guidelines.rb 我有
index do                            
column :title
column :specialty
column :content
column :hospital
column :country
column :user
default_actions
end

最佳答案

我不确定您从何处获取此表单代码,但我在使用 Active Admin 时遇到了同样的问题,并通过明确指示表单将该字段视为字符串来解决该问题:

ActiveAdmin.register Guideline do

form do |f|
f.inputs 'Details' do
f.input :country, :as => :string
end
f.actions
end

end

关于ruby-on-rails - 要使用 :country input, 请安装 country_select 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15536606/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com