CRUD implementation for Projects and Tasks

This commit is contained in:
KaungKaung
2026-01-27 16:51:35 +06:30
parent ec595da889
commit 142e14743a
2 changed files with 79 additions and 0 deletions

View File

@@ -19,4 +19,30 @@ class ProjectsController < ApplicationController
render :new
end
end
def edit
@project = Project.find(params[:id])
end
def update
@project = Project.find(params[:id])
if @project.update(project_params)
redirect_to @project
else
render :edit
end
end
def destroy
@project = Project.find(params[:id])
@project.destroy
redirect_to projects_path
end
private
def project_params
params.require(:project).permit(:project_name, :description)
end
end