Paulo J. Matos wrote:
I am learning rails by going through 3rd ed of the Rails book.
In page 153, after creating the user scaffold it says:
“Since this modified config/routes.rb, which is cached for performance
reasons, you will need to start the server.”
This is confusing me, what changed config/routes.rb? The creation of the
But this is confusion because we have created several scaffolds before
for orders, line_items, etc and this was never told to us before. Why
These are two disjoint topics.
Firstly, a “scaffold generator” typically edits a few files. Use your
version controller to see what it did to routes.rb. (And if you don’t
version controller, such as git or svn, install it now!)
Secondly, when you change a Model, Controller, or View, Rails knows to
reload the source when you go to the browser and refresh (usually F5).
However, Rails naturally can’t extend this benefit to all source.
Otherwise it could end up reloading all of Ruby’s standard library and
everything! So routes.rb is one of the files you must bounce the server
Next, despite scaffolds will take you a long way, you must soon stop
them, and start writing features directly. Learn that, with unit tests,
you will be reading to roll with Rails!