新手问题 formbuilder 可不可以生成不带 type 和 id 的 input

fan124 · May 17, 2017 · Last by jasl replied at May 19, 2017 · 1330 hits

如题、有没有<%= f.xxxx %>
可以生成<input type="">

那就直接写 input

Reply to Stone

好像只能直接写了

...加参数不就可以了

Reply to hging

不好意思,能给个例子吗?

type: ''

Reply to fan124

官方文档可以参考下。应该不难。

<%= f.text_field :column_name, id: 'my_id' %>
Reply to Garrus

这个可以😀

Reply to Stone

好吧,好像这样就行,<%= f.text_field :column_name, type: '', id: '' %>😀

自己封装一个吧,随便把 text_field 之类的控件的代码复制出来,短路掉你不想要的属性

You need to Sign in before reply, if you don't have an account, please Sign up first.