运行rails时出现以下错误 RoR 5.1.5乘客独立
ActionController :: RoutingError(未定义的方法' before_filter' for ApplicationController:Class你的意思? before_action):
app / controllers / application_controller.rb:4:in' include' 应用程序/控制器/ application_controller.rb:4:在 `' app / controllers / application_controller.rb:1:in'' app / controllers / welcome_controller.rb:1:in'' ^ CExitingStopping Web服务器......
application_controller.rb
class ApplicationController < ActionController::Base
before_action :require_login
include Mobylette::RespondToMobileRequests
private
def not_authenticated
redirect_to login_path, alert: "Please login first"
end
end