ChapterÂ 3.Â Inserting, Updating, and Deleting: Everything changes
Change is a fact of lifeâespecially for data. So far youâve seen how to whip up a quick Rails application with scaffolding, and how to write your own code to publish data from a database. But what if you want users to be able to edit data your way? What if scaffolding doesnât do what you want? In this chapter, youâll learn how to insert, update, and delete data in exactly the way you want. And while youâre doing that, youâll be taken deeper into how Rails really works and maybe even learn a little about security along the way.
People want to post new ads online
People love the MeBay site, but thereâs a problem. Because MeBay was nervous about people having too much access to the data, sellers have to phone in details of their items to MeBay and wait while the system administrators create new ads for the sellers. As the number of people sending in ads has grown, so has the wait time. A lot of people are taking their business to other advertising sites now.
So MeBay has relented. After some discussion, theyâve decided that people should be allowed to post their own ads on the site using a page that looks like this:
You already know how to build an app that publishes data from the database
The ads only go one ...