- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的指南模型有一个国家属性。我不想使用插件,我只想将国家作为字符串。一切正常,直到我尝试在 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%>
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/
我把它放在我的 gemfile 中 gem 'country_select' 我运行捆绑安装 我把这个放在我的表格里 = f.country_select(:country, priority_cou
我无法将此选择国家/地区插件 ( https://github.com/scudco/country_select_test) 集成到我的测试应用程序中。我安装了它并将其放入我的数据库中。当我在 ra
我一直在尝试实现 country_select gem 到我的应用程序中,以便用户可以在注册过程中选择一个国家(设计)。 我希望根据用户的区域设置翻译国家/地区列表。它实际上翻译成几 language
我在 Rails 应用程序中设置 gem 时遇到问题。我正在做以下事情: gem 'country_select', :git => 'git://github.com/rails/country_s
我用过 country_select gem,它工作正常,现在我想将选项值设置为与下拉列表中显示的国家名称相同的完整国家名称,而不是国家代码。 例如:我会像下面这样: Australia
我在 Rails 4 的表单标签中使用 country_select gem: 我收到以下错误。 undefined method `NZ' for
试图启动并运行 carmen_rails 以将国家和次区域(州)添加到我的家庭用户注册中,但遇到了一个问题,我在任何在线搜索中几乎没有帮助(至少从我能找到的内容来看)。 已安装 gem 'carmen
我的指南模型有一个国家属性。我不想使用插件,我只想将国家作为字符串。一切正常,直到我尝试在 activeadmin 中编辑指南,然后收到错误消息: ActionView::Template::Erro
我目前正在为 ruby on rails 使用 country_select gem: https://github.com/stefanpenner/country_select 以下代码打印所
我正在使用 best_in_place gem 内联编辑记录和 country_select呈现可供选择的国家/地区列表。当使用 best_in_place 编辑选择字段时,我这样做: :selec
我已经添加了 gem 'country-select'到我的 gemfile,我需要在选择中列出所有国家。我试试 但国家没有出现。文档中没有关于此的信息。请帮我解决这个问题。 最佳答案 试试这个 关
我用这个把头发拉出来。我尝试安装 Carmen gem,然后将其卸载并尝试将其作为插件,然后卸载插件并重新安装 gem,重新启动服务器,但似乎没有任何帮助。 不管我做什么,代码似乎都找不到“count
我是一名优秀的程序员,十分优秀!