0
我在控制器中有一些辅助方法和私有方法,我想在另一个控制器中使用相同的辅助方法和私有方法。所以我将该代码移到了模块中,并尝试将模块包含在第二个控制器中。但我似乎无法做到这一点,因为它说DashboardHelper的未定义方法助手方法。无论如何要完成我想要做的事情吗?如何将辅助方法和私有方法放在帮助器中
这里是你的代码必须包括在您的关心extend ActiveSupport::Concern
module DashboardHelper
def get_date(log)
end
def get_working_hours(log)
end
helper_method :get_date, :get_working_hours
private
def employee_params
end
def identify_employee
end
def check_is_arrived
end
def calculate_time_percentage
end
end
class AccountController < ApplicationController
include DashboardHelper
end