When I start a rails server and try a test app, changes to controller files arent reflected


Just starting out with Rails so bear with me.

I was working on a test app and everything was going great. However now when I run “rails server” and none of the changes to the controller files are reflected.

If I make changes to HTML files, those are reflected. And yes, I’m sure im in the right directory editing the correct files.

I can get rid of actions in the controller files and it still works fine. Do I have to do something after I change the ruby files? I thought I could just save them then run ‘rails server’… It had seemed to be working doing just that previously.


You don’t have to restart the running server. Just save a modified file and refresh your page in the browser (F5 or CTRL F5 or CMD+R for OS X).

If you still have problems unsolved, post the related code to see what you had changed. You can also look your development.log file to see what is going on.

Have you only been testing deleting actions? If so you might have been fooled by the fact that you don't have to define a controller method for an action - as long as there is a template rails will render that automatically.

Another thing to lookout for is using require to load your controllers/models - that will confuse the code reloading system (it's fine to use it for gems, the ruby standard library etc)


Just starting out with Rails? Read my free book on rails : 7 Step Framework for Coding Skills Acquisition. Once you finish the book you will know how the reloading process works and also learn about the controllers, views, models and more.