Skip to content
This repository was archived by the owner on Jul 21, 2024. It is now read-only.

Commit 90b2253

Browse files
committed
Set correct URL in tasks JSON builder
I want to use the tasks JSON builder to demonstrate using controller tests for non-HTML requests and responses, but the scaffold-generated builder in place now doesn't account for the fact that the tasks resource is nested under projects. Update the builder to build the correct route.
1 parent 0fd353a commit 90b2253

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/tasks/_task.json.jbuilder

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
json.extract! task, :id, :name, :project_id, :completed, :created_at, :updated_at
2-
json.url task_url(task, format: :json)
2+
json.url project_task_url([task.project, task], format: :json)

0 commit comments

Comments
 (0)