“undefined method” when calling helper method from controller in Rails

后端 未结 11 2103
傲寒
傲寒 2020-12-12 22:36

Does anyone know why I get

undefined method `my_method\' for #

when I call my_method(\"string\") from withi

11条回答
  •  没有蜡笔的小新
    2020-12-12 22:41

    Try appending module_function(*instance_methods) in your helper modules, after which you could directly call those methods on the module itself.

提交回复
热议问题