ruby-on-rails - 尝试使用邮递员登录时出现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
谢谢!
解决方案
Resaponse
里面是什么include Resaponse
?我认为Response
如果您的文件名是response.rb
并且类名是Response
推荐阅读
- flutter - Dart:forEach 方法参数接受 void 但即使返回 int 也可以
- linkedin - Linkedin 最新更新/活动
- reactjs - How to get data from prop.location.state in react?
- c - 如何在不使用 stat() 的情况下检测到我在 C 中打开()了一个目录?
- javascript - Json Pipe - 无法将字段设置为空
- c++ - Index size of an array
- java - 为什么会这样编译?覆盖方法不是异常的子类
- appveyor - Building different Solution Configuration in Appveyor for each platform
- python - 如何为可执行的 python 脚本包含可选输入?
- cefsharp - CEFSharp 的 ECCN(出口管制分类号)