@@ -773,24 +773,22 @@ 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 (entire resource) - Handles the form submission to update the entire resource.
788
+ This is typically triggered by a PUT request, replacing all attributes of the resource.
789
+ * Update (specific attributes only) - Handles the form submission to update specific
790
+ attributes of the resource. This is typically triggered by a PATCH request,
791
+ making partial updates to the resource.
794
792
* Destroy - Handles deleting a specific record
795
793
796
794
We can add routes for these CRUD actions with the following:
0 commit comments