首页 > 解决方案 > 尝试使用邮递员登录时出现Rails路由错误

问题描述

昨晚,一切正常,现在我正在启动 Rails 服务器并尝试登录,但显示如下

ActionController::RoutingError(未初始化的常量 ApplicationController::Resaponse):

app/controllers/application_controller.rb:2:in `<class:ApplicationController>'

应用程序有点大,我很困惑我为这个错误做了什么。

这是我的application_controller代码

class ApplicationController < ActionController::API
    include Resaponse
    include ExceptionHandler
    # called before every action on controllers
    before_action :authorize_request
    attr_reader :current_user
    
    private
    
    # Check for valid request token and return user
    def authorize_request
        @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]
    end

end

谢谢!

标签: ruby-on-railsrouting

解决方案


Resaponse里面是什么include Resaponse?我认为Response如果您的文件名是response.rb并且类名是Response


推荐阅读