Skip to content

Instantly share code, notes, and snippets.

@nchelluri
Created October 16, 2017 16:09
Show Gist options
  • Save nchelluri/fc0fa8861bf4df3cfcc4734e9b9f66be to your computer and use it in GitHub Desktop.
Save nchelluri/fc0fa8861bf4df3cfcc4734e9b9f66be to your computer and use it in GitHub Desktop.
I have come from a Rails background where webapps use seven "verbs" for routing.
Method Path Name Action
GET /resources resources_url Resources#index (listing)
POST /resources " Resource#create (INSERT)
GET /resources/new new_resource_url Resource#new (form)
GET /resources/:id resource_url(id) Resource#show (SELECT)
PUT /resources/:id " Resource#update (UPDATE)
DELETE /resources/:id " Resource#destroy (DELETE)
GET /resources/:id/edit edit_resource_url(id) Resource#edit (form)
These provide a standard vocabulary for interacting with RESTful resources. It's still pretty early in Mojo days. I think we could use something like this. Any thoughts? Mojo supports all of these methods from the browser using the _method parameter.
http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment