File tree Expand file tree Collapse file tree
java/org/launchcode/codingevents/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import org .springframework .web .bind .annotation .RequestMapping ;
1515
1616@ Controller
17- @ RequestMapping
17+ @ RequestMapping ( "eventCategories" )
1818public class EventCategoryController {
1919
2020 @ Autowired
@@ -27,14 +27,14 @@ public String displayAllCategories(Model model) {
2727 return "eventCategories/index" ;
2828 }
2929
30- @ GetMapping
30+ @ GetMapping ( "create" )
3131 public String renderCreateEventCategoryForm (Model model ) {
3232 model .addAttribute ("title" , "Create Category" );
3333 model .addAttribute (new EventCategory ());
3434 return "eventCategories/create" ;
3535 }
3636
37- @ PostMapping
37+ @ PostMapping ( "create" )
3838 public String processCreateEventForm (@ Valid @ ModelAttribute EventCategory eventCategory ,
3939 Errors errors , Model model ) {
4040 if (errors .hasErrors ()) {
Original file line number Diff line number Diff line change 11# Database connection settings
22spring.datasource.url =jdbc:mysql://localhost:3306/coding_events
3- spring.datasource.username =user
4- spring.datasource.password =password
3+ spring.datasource.username =coding_events
4+ spring.datasource.password =Learn2code!
55
66# Specify the DBMS
77spring.jpa.database = MYSQL
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ <h1 th:text="${title}">Coding Events</h1>
1515 < li class ="nav-item "> < a class ="nav-link " href ="/events "> All Events</ a > </ li >
1616 < li class ="nav-item "> < a class ="nav-link " href ="/events/create "> Create Event</ a > </ li >
1717 < li class ="nav-item "> < a class ="nav-link " href ="/events/delete "> Delete Events</ a > </ li >
18+ < li class ="nav-item "> < a class ="nav-link " href ="/eventCategories "> All Categories</ a > </ li >
19+ < li class ="nav-item "> < a class ="nav-link " href ="/eventCategories/create "> Create Category</ a > </ li >
1820 </ ul >
1921</ nav >
2022
You can’t perform that action at this time.
0 commit comments