Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails找不到我的一个控制器_Ruby On Rails - Fatal编程技术网

Ruby on rails Rails找不到我的一个控制器

Ruby on rails Rails找不到我的一个控制器,ruby-on-rails,Ruby On Rails,我正在尝试在我的设计注册中自定义注册后路径。根据,我创建了一个名为therapists\u registrations\u controller.rb的新控制器,但当我启动服务器并加载页面时,我得到ActionController::RoutingError(未初始化的常量治疗师注册控制器) 现在,therapists\u registrations\u controller.rb位于app/controllers/api/therapists\u registrations\u control

我正在尝试在我的设计注册中自定义注册后路径。根据,我创建了一个名为
therapists\u registrations\u controller.rb
的新控制器,但当我启动服务器并加载页面时,我得到
ActionController::RoutingError(未初始化的常量治疗师注册控制器)

现在,
therapists\u registrations\u controller.rb
位于
app/controllers/api/therapists\u registrations\u controller.rb
,所有其他控制器都加载,我不玩任何带有
自动加载路径的游戏。有什么问题吗

这是在Rails 3.2.11上。控制器的代码为:

class TherapistsRegistrationsController < Devise::RegistrationsController

  protected
  def after_inactive_sign_up_path_for(resource)
    "http://google.com"
  end  
end
职业治疗师注册控制器
原因之一可能是类名。由于在app/controllers/api中有
therapists\u registrations\u controller.rb
,因此类名应为

class Api::TherapistsRegistrationsController < Devise::RegistrationsController


你可以发布你的路线文件吗,你是否使用了
deveave\u for:users,:controllers=>{:registrations=>“therapists\u registrations”}
以下是相关部分:
deveave\u for:therapists,:controllers=>{:registrations=>“therapists\u registrations”}
。治疗师注册\u controller.rb
的路径是什么
app/api
app/controllers/api
?这是
app/controllers/api/therapists\u registrations\u controller.rb
@Johnny Ok。另外,请尝试将此
design\u for:therapists,:controllers=>{:registrations=>“therapists\u registrations”}
更改为
design\u for:therapists,:controllers=>{:registrations=>“api/therapists\u registrations”}
devise_for :therapists, :controllers => { :registrations => "therapists_registrations" }
devise_for :therapists, :controllers => { :registrations => "api/therapists_registrations" }