Skip to content

Commit

Permalink
add better naming for api controller methods
Browse files Browse the repository at this point in the history
reference:

Phoenix Framework
```
user_path  GET     /users           HelloWeb.UserController :index
user_path  GET     /users/:id/edit  HelloWeb.UserController :edit
user_path  GET     /users/new       HelloWeb.UserController :new
user_path  GET     /users/:id       HelloWeb.UserController :show
user_path  POST    /users           HelloWeb.UserController :create
user_path  PATCH   /users/:id       HelloWeb.UserController :update
           PUT     /users/:id       HelloWeb.UserController :update
user_path  DELETE  /users/:id       HelloWeb.UserController :delete
```

Rails:
```
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
```
  • Loading branch information
vaibhavmule authored Oct 1, 2018
1 parent 35f0cfd commit 8ae4f68
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions masonite/snippets/scaffold/controller_resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@
"""Class Docstring Description
"""

def show(self):

def index(self):
"""Show several resource listings
"""

pass

def index(self):
def show(self):
"""Show a single resource listing
"""

pass

def create(self):
def new(self):
"""Show form to create new resource listings
"""

pass

def store(self):
def create(self):
"""Create a new resource listing
"""

Expand All @@ -41,7 +42,7 @@

pass

def destroy(self):
def delete(self):
"""Delete an existing resource listing
"""

Expand Down

0 comments on commit 8ae4f68

Please sign in to comment.