Skip to content

Commit 156fbd8

Browse files
committed
completed creating and rendering a form
1 parent 828553a commit 156fbd8

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Spring Boot/codingevents/src/main/java/org/launchcode/codingevents/controllers/EventController.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ public String displayAllEvents(Model model) {
2323
return "events/index";
2424
}
2525

26+
// lives at /events/create
27+
@GetMapping("create")
28+
public String renderCreateEventForm() {
29+
return "events/create";
30+
}
31+
2632
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Create Event</title>
6+
</head>
7+
<body>
8+
9+
<h1>Create Event</h1>
10+
11+
<form method="post" action="/events/create">
12+
<input type="text" name="eventName">
13+
<input type="submit" value="Create Event">
14+
</form>
15+
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)