-6ren">
gpt4 book ai didi

ruby-on-rails - 在简单表单中手动设置表单输入字段的 ID?

转载 作者:行者123 更新时间:2023-12-02 05:32:20 25 4
gpt4 key购买 nike

是否可以否决 simpleform 对表单中文本字段的命名?

这个:

= f.input_field :age_from,

输出:

<input type="text" size="50" name="/people/search[query]" id="_people_search_query">

应该是

<input type="text" size="50" name="/people/search[query]" id="query">

我试过了* :name => "查询"* :id => "查询"

没用

最佳答案

像您的其他问题一样,html 选项应该在 simple_form 中的 input_html 散列中传递:

<%= f.input :age_from, ..., :input_html => { :id => 'my_id' } %> should work.

关于ruby-on-rails - 在简单表单中手动设置表单输入字段的 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12202142/

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