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

后端 未结 11 2089
傲寒
傲寒 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 23:02

    As said by gamecreature in this post:

    • In Rails 2 use the @template variable.
    • In Rails 3 use the controller method view_context

提交回复
热议问题