Skip to content

Commit 52afe9c

Browse files
author
Lee Richmond
committed
Fix tutorial step
1 parent 60a2149 commit 52afe9c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tutorial/step_2.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,25 @@ let(:payload) do
217217
attributes: { },
218218
relationships: {
219219
employee: {
220-
data: employee.id.to_s,
221-
type: 'employees'
220+
data: {
221+
id: employee.id.to_s,
222+
type: 'employees'
223+
}
222224
}
223225
}
224226
}
225227
}
226228
end
227229
{% endhighlight %}
228230

231+
To ensure the `PositionResource` will process this relationship, the
232+
last step is to add it:
233+
234+
{% highlight ruby %}
235+
# app/resources/position_resource.rb
236+
belongs_to :employee
237+
{% endhighlight %}
238+
229239
This will associate the `Position` to the `Employee` as part of the
230240
creation process. The test should now pass - make the same change to
231241
`spec/api/v1/positions/create_spec.rb` to get a fully-passing test

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy