在表单字段中输入的ActiveAdmin自定义值 [英] ActiveAdmin custom values entered into form fields
本文介绍了在表单字段中输入的ActiveAdmin自定义值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Rails 4中有一个ActiveAdmin项目。由于某些原因,当我使用:value => some_value
对于字段没有任何变化。它只是显示为一个空文本字段。
I have an ActiveAdmin project in Rails 4. For some reason when I use the :value => some_value
for a field nothing changes. It just shows up as an empty text field.
以下是我的表单示例:
form do |f|
f.inputs "Template Details" do
f.input :inventory_type, :value => "test"
f.input :body_type
f.input :section
f.input :formula
f.input :trait
end
f.actions
stocker_type字段在呈现时为空白。我尝试了所有其他结果相似的字段。
The inventory_type field is blank when it renders. I've tried all the other fields with similar results.
推荐答案
请尝试以下操作::input_html => ; {:value => test}
这篇关于在表单字段中输入的ActiveAdmin自定义值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文