Trip
Trip

Reputation: 27114

Why is Heroku failing to understand routes but my local does?

My routes :

namespace :admin do
  resources :manage_users do

And then I can have my controller in /controllers as :

class ManageUsersController < ApplicationController

Which works fine. I go to /admin/manage_users and I get my index.

But on Heroku I get :

ActionController::RoutingError (uninitialized constant Admin::ManageUsersController):

Why? :D

Upvotes: 2

Views: 49

Answers (2)

Trip
Trip

Reputation: 27114

I moved the controller without renaming it to :

controllers/admin/

And my views as well. Works locally and on Heroku.

Upvotes: 0

Adam Becker
Adam Becker

Reputation: 363

Restart your development server and you will most likely see the same error.

When you use a namespace, Rails expects your controller to be Admin::ManageUsersController. See the Rails Routing guide: http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing

Upvotes: 1

Related Questions