Rename app>controller subfolder crashes app


#1

Help,

I changed a folder name in my app>controller from admin to company and
now I get a company is not a class error.

I do not have any custom routes set and have changed all references to
admin, no joy.

Does ruby / rails have a cache of the names?


#2

James W. wrote:

Help,

I changed a folder name in my app>controller from admin to company and
now I get a company is not a class error.

I do not have any custom routes set and have changed all references to
admin, no joy.

Does ruby / rails have a cache of the names?
Kinda.

First things first: have you restarted the web server?


#3

Alex Y. wrote:

James W. wrote:

Help,

I changed a folder name in my app>controller from admin to company and
now I get a company is not a class error.

I do not have any custom routes set and have changed all references to
admin, no joy.

Does ruby / rails have a cache of the names?
Kinda.

First things first: have you restarted the web server?

Yes restarted, i’m running webrick on windows in dev mode.


#4

James W. wrote:

Does ruby / rails have a cache of the names?
Kinda.

First things first: have you restarted the web server?

Yes restarted, i’m running webrick on windows in dev mode.
Where’s the error being thrown from? What’s the full error?


#5

Alex Y. wrote:

James W. wrote:

Does ruby / rails have a cache of the names?
Kinda.

First things first: have you restarted the web server?

Yes restarted, i’m running webrick on windows in dev mode.
Where’s the error being thrown from? What’s the full error?

The error on the page is:

TypeError in #

Company is not a class

RAILS_ROOT: ./script/…/config/…

When I look at the full trace I get:

This error occured while loading the following files:
./script/…/config/…/app/controllers/company/accounts_controller.rb
./script/…/config/…/app/controllers/company/base_controller.rb
login_system_employee.rb
employee.rb
company.rb


#6

James W. wrote:

This error occured while loading the following files:
./script/…/config/…/app/controllers/company/accounts_controller.rb

I don’t suppose there were any line numbers mentioned? What does
accounts_controller.rb look like?

What URL are you trying to access that triggers this?


#7

Alex Y. wrote:

James W. wrote:

This error occured while loading the following files:
./script/…/config/…/app/controllers/company/accounts_controller.rb

I don’t suppose there were any line numbers mentioned? What does
accounts_controller.rb look like?

What URL are you trying to access that triggers this?

No line numbers are mentioned. I have run powerGrep to find all
instances of Admin in the entire project and replaced them with Company.
Still no joy.

I think that once you create a controller sub folder you are stuck with
that, it cannot be changed.

the URL i’m trying is: http://localhost:3000/company/accounts/login
Al the views have been changed & tests still not working.


#8

Alex Y. wrote:

James W. wrote:

the URL i’m trying is: http://localhost:3000/company/accounts/login
Al the views have been changed & tests still not working.
Just a hunch: try http://localhost:3000/company/accounts/login/ and see
if that works.

No joy there. Thanks for your help. I think this is one for the lessons
learnt folder.

Result: still not resolved.


#9

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#10

James W. wrote:

the URL i’m trying is: http://localhost:3000/company/accounts/login
Al the views have been changed & tests still not working.
Just a hunch: try http://localhost:3000/company/accounts/login/ and see
if that works.