Part of an introductory Ruby and Rails curriculum for more than 100 freshman students for a summer application development course (NUS Orbital) at the National University of Singapore.
web sites are the same. They need to store records and provide a way to do the following: • Create new records in the database • Read or show the records in the database • Update existing records • Destroy or delete records Because these 4 actions are so common, Rails includes the scaffold command to make creating them easier. rails generate scaffold Confession title:string body:text
A new controller for Comments ◦ A ‘create’ action to save new Comments to the DB • A new route in routes.rb for ‘comments#create’ • A view form for users to write a Comment Building a Dynamic Site