Skip to content

Commit

Permalink
Fix location for JSON requests in tasks controller
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiIto committed Jan 1, 2024
1 parent 46bf86e commit 74efd61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create
respond_to do |format|
if @task.save
format.html { redirect_to @project, notice: "Task was successfully created." }
format.json { render :show, status: :created, location: @task }
format.json { render :show, status: :created, location: [@task.project, @task] }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @task.errors, status: :unprocessable_entity }
Expand All @@ -36,7 +36,7 @@ def update
respond_to do |format|
if @task.update(task_params)
format.html { redirect_to @project, notice: "Task was successfully updated." }
format.json { render :show, status: :ok, location: @task }
format.json { render :show, status: :ok, location: [@task.project, @task] }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @task.errors, status: :unprocessable_entity }
Expand Down

0 comments on commit 74efd61

Please sign in to comment.