你怎么解决? formtastic:label_method不再可用

时间:2021-12-05 15:57:26

Ok.. I'm new to ruby/rails. So to compensate for my weakness, my company had a guy come in to help me create the bones of our website. He put in formtastic :label_method, so we could change what fields are displayed in the DDLB. When I moved my project to a new box, I got this error.

好的..我是ruby / rails的新手。所以为了弥补我的弱点,我的公司有一个人来帮我创建我们网站的骨头。他输入了formtastic:label_method,因此我们可以更改DDLB中显示的字段。当我将项目移动到新框时,我收到了此错误。

:label_method is no longer available

:label_method不再可用

What I'm wondering is.. what do I use in it's place?

我想知道的是......我在这个地方使用了什么?

2 个解决方案

#1


10  

I think it might be:

我想可能是:

:member_label

According to http://rubydoc.info/gems/formtastic/2.0.0/Formtastic/Helpers/InputHelper

根据http://rubydoc.info/gems/formtastic/2.0.0/Formtastic/Helpers/InputHelper

"(Symbol, Proc, Method) — Deprecated, renamed to :member_label"

“(符号,过程,方法) - 已弃用,已重命名为:member_label”

If that doesn't work could you post your _form for us to see?

如果这不起作用,你可以发布你的_form给我们看吗?

#2


2  

:member_label is the thing to use!

:member_label是要用的东西!

EDIT: More recently, I could not get both of these (including :label_method) to work. The way I used was to define a to_label method on the model.

编辑:最近,我无法让这两个(包括:label_method)工作。我使用的方法是在模型上定义to_label方法。

#1


10  

I think it might be:

我想可能是:

:member_label

According to http://rubydoc.info/gems/formtastic/2.0.0/Formtastic/Helpers/InputHelper

根据http://rubydoc.info/gems/formtastic/2.0.0/Formtastic/Helpers/InputHelper

"(Symbol, Proc, Method) — Deprecated, renamed to :member_label"

“(符号,过程,方法) - 已弃用,已重命名为:member_label”

If that doesn't work could you post your _form for us to see?

如果这不起作用,你可以发布你的_form给我们看吗?

#2


2  

:member_label is the thing to use!

:member_label是要用的东西!

EDIT: More recently, I could not get both of these (including :label_method) to work. The way I used was to define a to_label method on the model.

编辑:最近,我无法让这两个(包括:label_method)工作。我使用的方法是在模型上定义to_label方法。