Rename app>controller subfolder crashes app

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?

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?

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.

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?

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

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?

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.

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.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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.