-
CRUD stands for Create, Read, Update and Delete. These are the 4 basic functions for managing a database.
-
So there are seven verb + path combos, the first two are Create-POST and Create-PUT. They are very similar but only difference is you use the POST method to create a new item for the database and the PUT method to modify a current item from the database. The next verb/path combo is Read-GET and this is the way you retrieve data from a webpage for viewing purposes only. The next three are Update-PUT, Update-POST and Update-PATCH. I believe the Update-PUT is modifying a current item within a database, which is also what I believe Update-POST does. Only difference is that Update-POST is for older frameworks that don't use the new PUT method yet. Next is Update-PATCH, which I believe is only a partial modification to an existing item within a database. And last is the Delete-DELETE verb/path combo and this just deletes an item altogether from within a database.
-
The 'set method_override: true' is to over-write the POST and GET methods to use with web frames that don't have it built in.
-
The 'value' is a predetermined value that will show up and the 'name' value will overwrite the 'value' once you hit submit.
-
The 'params' are the parameters that are sent along with the POST or PUT methods to create or change items within a database. Actually I guess PATCH and DELETE would also have params..
Forked from rwarbelow/cfu_crud_in_sinatra.markdown
Last active
February 3, 2016 00:38
-
-
Save NickyBobby/ea7dff3a9234554b6508 to your computer and use it in GitHub Desktop.
CRUD in Sinatra -- Check for Understanding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
method_overrideto be able to send PUT and DELETE requests even though browsers only support GET and POST.namebecomes the key in theparamshash.valuewill be its value./tasks/6/edit, we could access the 6 fromparams[:id])