2009/8/8 Phlip <[email protected]>: > > 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 >> scaffold? >> 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 >> now? > > 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_!)
Definitely agree with this. I would suggest git, which has a bit of a learning curve but will be time well spent. > > 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 > you edit. This does not answer the OP's question as to why he got this message this time but not previously. Is it possible that the server was running this time so the message was produced, otherwise it is not produced (though I am not sure the scaffold generator would know that). Paulo, I wouldn't worry about it if I were you, just restart if necessary and carry on. > > 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! > > -- I disagree with that, keep using the scaffold generator to add new stuff, it is by far the easiest way of generating the files generally needed. Then use this as the base on which to build your application specific stuff. There may come a point at which it is easier to add new stuff entirely by hand but I certainly have not got there yet. Don't forget to commit your source to your version control system after running the generator so you can look back and see what you changed. Colin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

