DEV Community

CRUD in Rails 7

Rutvik Patel on February 12, 2023

CRUD in Rails 7 In this article, we are going to create a CRUD application in rails 7. We are going to use Rails 7.0.4.2 and Ruby 3.1...
Collapse
 
superails profile image
Yaroslav Shmarov

small remark: create, update, delete are not get requests

Collapse
 
rutikkpatel profile image
Rutvik Patel • Edited

First and foremost, thank you so much @superails for taking the time to read my article. Your youtube tutorials are extremely beneficial to my learning. 

And, yes, you are correct. create , update , delete are not get requests.

A POST request is to "create."

The PATCH request is "update".

A DESTROY or DELETE request is to "delete".

But when we generate the controller with rails g controller employees index new create show edit update destroy . The routes will be automatically added as

get 'employees/create'
get 'employees/update'
get 'employees/destroy'

Image description