我有两个控制器,即1)carts_controller 2)orders_controller
class CartsController < ApplicationController
helper_method :method3
def method1
end
def method2
end
def method3
# using method1 and method2
end
end
Run Code Online (Sandbox Code Playgroud)
注意:method3正在使用method1和method2.
CartsController有showcart.html.erb视图使用method3并且工作正常.
现在在顺序视图中,我需要显示cart(showcart.html.erb)但是由于method3定义了帮助程序carts_controller所以它无法访问它.
怎么解决?