Develop both the view and back-end logic for students to view their team, edit team details (name, description), and create a new team if not part of one.
Key Elements:
Conditional Rendering for Teams:
Check if the student belongs to a team.
Display the current team’s name, description, and members with "Edit Team Details" and "Leave Team" buttons.
If the student doesn’t belong to a team, display a "Create a New Team" button and list other available teams with "Join Team" buttons.
Create and Edit Team Form:
Create a form to allow students to input Team Name and Team Description.
Pre-fill the form with the current team’s details if the student is editing.
Validate input fields (team name presence, character limits).
Include error handling and ensure proper display of validation errors on the form.
Controller Logic for Team Management:
Implement edit, update, new, and create actions in the controller:
Edit: Pre-load the current team data.
Update: Save updated team details.
New: Display the form for creating a new team.
Create: Handle form submission and save the new team, associating the student with it.
Error Handling and Validation:
Validate team name for presence and apply character limits on name and description.
Display errors if the form contains invalid data, and ensure the form is not saved until all issues are resolved.
Description:
Develop both the view and back-end logic for students to view their team, edit team details (name, description), and create a new team if not part of one.
Key Elements:
Conditional Rendering for Teams:
Create and Edit Team Form:
Controller Logic for Team Management:
edit
,update
,new
, andcreate
actions in the controller:Error Handling and Validation:
Routing: