12. “Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.” -Nathan Torkington, O'Reilly Program Chair for OSCON
30. UsersController Id = 1 GET UsersController#show POST UsersController#create PUT UsersController#update DELETE UsersController#destroy
Notes de l'éditeur
Unlike other frameworks *caugh* ASP.NET MVC *caugh*
But you also probably have noticed by now that there’s probably something good about it. So let’s deep dive right away and see why everybody’s talking about it.-- DEMO – create a new rails app, generate scaffold person, run (run the pre-made demo)
Generate scaffold dog name, person_idrake db:migratehas_many for personShow SQL statememnts in log
CoC
Present the view of the show person actionUse a file to show dogs (pre-prepared) and add to the person#show view (first by render_partial… then by render)Respond_to in the controller
Show the consoleShow Person.allShow fun stuff – pluralize, singularize, 3.days.ago, 3.megabytes, Time.now.tomorrow…