You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/source/getting_started.md
+3-8Lines changed: 3 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -773,24 +773,19 @@ get "/blog/:title", to: "blog#show"
773
773
Rails will capture `hello-world` out of `/blog/hello-world` and this can be used
774
774
to look up the blog post with the matching title.
775
775
776
-
777
-
```ruby
778
-
get "/blog/:slug", to:"blog#show"
779
-
```
780
-
781
776
#### CRUD Routes
782
777
783
778
There are 4 common actions you will generally need for a resource: Create, Read,
784
-
Update, Delete (CRUD). This translates to 7 typical routes:
779
+
Update, Delete (CRUD). This translates to 8 typical routes:
785
780
786
781
* Index - Shows all the records
787
782
* New - Renders a form for creating a new record
788
783
* Create - Processes the new form submission, handling errors and creating the
789
784
record
790
785
* Show - Renders a specific record for viewing
791
786
* Edit - Renders a form for updating a specific record
792
-
* Update - Handles the edit form submission, handling errors and updating the
793
-
record
787
+
* Update (full) - Handles the edit form submission, handling errors and updating the entire record, and typically triggered by a PUT request.
788
+
* Update (partial) - Handles the edit form submission, handling errors and updating specific attributes of the record, and typically triggered by a PATCH request.
794
789
* Destroy - Handles deleting a specific record
795
790
796
791
We can add routes for these CRUD actions with the following:
0 commit comments