Last active
September 7, 2017 11:14
-
-
Save NSLog0/e8395b2fa2ce78e6dc04d69aeb58d9ac to your computer and use it in GitHub Desktop.
api naming article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
# get all data and connect with database(Back end logic) | |
# retun html file to client | |
render 'index' | |
end | |
def new | |
# retun html file to client | |
render 'new' | |
end | |
def show | |
# sometime we can say it's a find by id | |
# retun html file to client | |
render 'show' | |
end | |
def edit | |
# retun html file to client | |
render 'edit' | |
end | |
def create | |
# create data and connect with database(Back end logic) | |
end | |
def update | |
# update data and connect with database(Back end logic) | |
end | |
def delete | |
# delete data and connect with database(Back end logic) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Dogs { | |
private String name = ""; | |
public void say() { | |
System.out.print(this.name + " Woof!! Woof!!"); | |
} | |
public String getName() { | |
return this.name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} | |
// let say we have main class | |
Dogs d = new Dogs | |
d.setName("Bob"); | |
d.say(); // Bob Woof!! Woof!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|Method| |URI| |Controller and method| | |
GET /users users#index | |
POST /users users#create | |
GET /users/new users#new | |
GET /users/:id/edit users#edit | |
GET /users/:id users#show | |
PATCH /users/:id users#update | |
PUT /users/:id users#update | |
DELETE /users/:id users#destroy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment