我的应用程序助手中有以下代码。
route = ActionController::Routing::Routes.recognize_path(current_uri)
controller = route[:controller]
action = route[:action]
session['route']<< [controller.to_s,action.to_s]
我收到以下错误您没想到时有一个 nil 对象!您可能期望有一个 Array 的实例。评估 nil 时发生错误。<<
一些快速记录,我看到控制器和操作工作得很好。你不能在助手中创建会话吗?