我無法修復這個在Rails 3.2.12中,也許我錯過了一些東西。路由錯誤 - 未初始化的常量
配置/ routes.rb中
get "home/index"
root :to => "home#index"
devise_for :users, :only => :omniauth_callbacks
match 'users/auth/:provider/callback' => 'authentications#create'
match '/auth/:provider/signout' => 'authentications#signout'
應用程序/控制器/ authentication_controller.rb
class AuthenticationsController < ApplicationController
...
end
應用/模型/ authentication.rb
class Authentication < ActiveRecord::Base
...
end
我認爲它應該與我目前的知識一起工作,但有一些我錯過了。
我的親切的問題是告訴什麼是錯的,請。
Rounting錯誤
uninitialized constant AuthenticationsController
這是一個消息,在http://localhost:3000/auth/facebook/signout
哦。謝謝@alfonso。我以這種方式創建了控制器'rails g controller authentication',因此文件本身被命名爲'authentication_controller.rb',也許我更改了類名稱。非常感謝您回答這樣一個衆所周知的問題。 – Davit 2013-04-06 00:20:09
@Davit提示:在生成控制器時,您應始終使用複數形式。 – Bonifacio2 2014-03-13 18:08:05