Calling a method from another controller

后端 未结 4 751
逝去的感伤
逝去的感伤 2020-12-04 18:09

If I\'ve got a method in a different controller to the one I\'m writing in, and I want to call that method, is it possible, or should I consider moving that method to a help

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 18:27

    I don't know any details of your problem, but maybe paths could be solution in your case (especially if its RESTful action).

    http://guides.rubyonrails.org/routing.html#path-and-url-helpers

提交回复
热议问题