In my rails 3.2 project, I have some controllers like this:
/app/controllers/application_controller.rb
/app/controllers/college/application_controller.rb
/app/controllers/college/actors_controller.rb
The content of /app/controllers/college/actors_controller.rb like:
class College::ActorsController < College::ApplicationController
end
The content of /app/controllers/college/application_controller.rb like:
class College::ApplicationController < ApplicationController
before_filter do
puts "welcome"
end
end
If I modify the controller, reload the web browser.
The console can be output string “welcome”.
But when I shutdown the webrick, and restart webrick, then reload the web browser, the console doesn’t output “welcome”
It looks like College::ApplicationController not be loaded ?
And how can I fix it ?
We ran into something similar and fully defined class definitions solved our problem.
It’s worth trying to change
to
and
to