Skip to content

Instantly share code, notes, and snippets.

@ksdev-pl
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save ksdev-pl/b4ff45b8d7d41e2fe178 to your computer and use it in GitHub Desktop.

Select an option

Save ksdev-pl/b4ff45b8d7d41e2fe178 to your computer and use it in GitHub Desktop.
RESTful routes #metodyka
Verb Path Action Route Name
GET /resource index resource.index
GET /resource/create create resource.create
POST /resource store resource.store
GET /resource/{resource} show resource.show
GET /resource/{resource}/edit edit resource.edit
PUT/PATCH /resource/{resource} update resource.update
DELETE /resource/{resource} destroy resource.destroy
HTTP Verb Path Controller#Action Used for
GET /photos photos#index display a list of all photos
GET /photos/new photos#new return an HTML form for creating a new photo
POST /photos photos#create create a new photo
GET /photos/:id photos#show display a specific photo
GET /photos/:id/edit photos#edit return an HTML form for editing a photo
PATCH/PUT /photos/:id photos#update update a specific photo
DELETE /photos/:id photos#destroy delete a specific photo
  • /stores?search=near&lat=12.34&lon=-12.34
  • /collection/element/collection?foo=bar&filter=green
  • GET /tickets?sort=-updated_at - Retrieve recently updated tickets
  • GET /tickets?state=closed&sort=-updated_at - Retrieve recently closed tickets
  • GET /tickets?q=return&state=open&sort=-priority,created_at - Retrieve the highest priority open tickets mentioning the word 'return'
  • PUT /gists/:id/star
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment