Nested routes, Listed tasks associated with projects

This commit is contained in:
KaungKaung
2026-01-27 11:43:00 +06:30
parent fd0a6fb408
commit 6c3180f203
6 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
class ProjectsController < ApplicationController
def index
@projects = Project.all
end
def show
@project = Project.find(params[:id])
end
def new
@project = Project.new
end
def create
@project = Project.new(project_params)
if @project.save
redirect_to @project
else
render :new
end
end
end