-
Notifications
You must be signed in to change notification settings - Fork 451
/
Copy pathCRUD_with_scaffolding.step
59 lines (45 loc) · 1.99 KB
/
CRUD_with_scaffolding.step
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
goals {
message <<-MARKDOWN
At the core, most database driven web sites are the same. They need to store records and provide a way to do the following:
* **C**reate new records in the database
* **R**ead or show the records in the database
* **U**pdate existing records
* **D**estroy or delete records
Because these 4 actions (CRUD) are so common, Rails includes the scaffold command to make creating them easier.
MARKDOWN
}
steps {
step {
console "rails server"
tip "Now is a good time to figure out how to have multiple tabs or windows of your terminal or command prompt. Starting and stopping the Rails server all day is tedious, so it's good to have one terminal tab or window for running commands, and a separate one for the server."
}
step {
message "Point your browser to [http://localhost:3000/topics](http://localhost:3000/topics)"
message 'You should see the "Listing Topics" page with headers for title and description, and a link to add a new topic:'
img src: "img/Seattle_topic_list_page.png", alt: "Screenshot of topic list page"
}
step {
message <<-MARKDOWN
* Click on "New Topic"
* Fill in the form and click "Create Topic"
* You should see a page showing your new topic with a message that your topic was successfully created:
MARKDOWN
img alt: "Screenshot of topic detail page with confirmation message", src: "img/Seattle_topic_created.png"
}
step {
message <<-MARKDOWN
* Click on "Back"
* You should see the topic list again, this time with your new topic listed:

* Try the "show", "edit", and "destroy" links to see what they do
* You've created a basic database-driven web site. Congratulations!
MARKDOWN
}
}
explanation {
message <<-MARKDOWN
How did all those pages get created and hooked together? `rails scaffold` did it for you.
MARKDOWN
}
next_step "the_request_cycle_and_rails_architecture"