I\'m trying to learn the life cycle of a rails application. When is application_controller.rb run? Is it just once every time it\'s changed, or on every request?
I want
Here is what I observed by putting a bunch of print statements in the code:
The application_controller and the posts_controller (for example) are "run" on each request. Every line of code not inside a method def/end is executed in both controllers, and then code flow passes to the requested/routed method.
As this is not what I expected I thought it worthwhile to post it. If I'm wrong pls feel free to edit.
With Heroku, print statement output only shows up in the stdout log if the print statement is inside a method, for some reason. But I believe the above description still applies.