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 have a
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 if
Next, despite scaffolds will take you a long way, you must soon stop using
them, and start writing features directly. Learn that, with unit tests, and
you will be reading to roll with Rails!