You can't do this with vanilla Rails. Each time you type rails
(whether with server
or console
), you're booting a brand new instance of your application, which shares no state with any other instance.
However, if you install the extremely useful Pry gem, you can type binding.pry
at any point in your application (inside an action or model or view). When program flow hits your binding.pry
, the server instance will drop into an interactive shell, and you can inspect the state of your server process. This is about as close as you can get to what you're trying to do.